ソースを参照

WIP: Script bindings
- Ported all physics related classes to use SBGen for script export

BearishSun 8 年 前
コミット
f1062acc40
100 ファイル変更970 行追加5920 行削除
  1. 1 1
      Source/BansheeCore/Audio/BsAudioSource.h
  2. 11 7
      Source/BansheeCore/Components/BsCBoxCollider.h
  3. 19 11
      Source/BansheeCore/Components/BsCCapsuleCollider.h
  4. 31 6
      Source/BansheeCore/Components/BsCCharacterController.h
  5. 15 15
      Source/BansheeCore/Components/BsCCollider.cpp
  6. 21 4
      Source/BansheeCore/Components/BsCCollider.h
  7. 4 4
      Source/BansheeCore/Components/BsCD6Joint.cpp
  8. 29 10
      Source/BansheeCore/Components/BsCD6Joint.h
  9. 4 4
      Source/BansheeCore/Components/BsCDistanceJoint.cpp
  10. 19 8
      Source/BansheeCore/Components/BsCDistanceJoint.h
  11. 6 6
      Source/BansheeCore/Components/BsCFixedJoint.h
  12. 6 6
      Source/BansheeCore/Components/BsCHingeJoint.cpp
  13. 18 10
      Source/BansheeCore/Components/BsCHingeJoint.h
  14. 18 6
      Source/BansheeCore/Components/BsCJoint.h
  15. 9 7
      Source/BansheeCore/Components/BsCMeshCollider.h
  16. 15 11
      Source/BansheeCore/Components/BsCPlaneCollider.h
  17. 1 1
      Source/BansheeCore/Components/BsCReflectionProbe.h
  18. 31 25
      Source/BansheeCore/Components/BsCRigidbody.cpp
  19. 64 15
      Source/BansheeCore/Components/BsCRigidbody.h
  20. 1 1
      Source/BansheeCore/Components/BsCSkybox.h
  21. 4 4
      Source/BansheeCore/Components/BsCSliderJoint.cpp
  22. 14 8
      Source/BansheeCore/Components/BsCSliderJoint.h
  23. 13 9
      Source/BansheeCore/Components/BsCSphereCollider.h
  24. 4 4
      Source/BansheeCore/Components/BsCSphericalJoint.cpp
  25. 12 8
      Source/BansheeCore/Components/BsCSphericalJoint.h
  26. 1 1
      Source/BansheeCore/Image/BsPixelData.h
  27. 1 1
      Source/BansheeCore/Image/BsTexture.h
  28. 2 2
      Source/BansheeCore/Physics/BsCapsuleCollider.h
  29. 33 77
      Source/BansheeCore/Physics/BsCharacterController.h
  30. 3 3
      Source/BansheeCore/Physics/BsCollider.h
  31. 87 89
      Source/BansheeCore/Physics/BsD6Joint.h
  32. 20 35
      Source/BansheeCore/Physics/BsDistanceJoint.h
  33. 9 15
      Source/BansheeCore/Physics/BsFJoint.h
  34. 43 54
      Source/BansheeCore/Physics/BsHingeJoint.h
  35. 8 8
      Source/BansheeCore/Physics/BsJoint.h
  36. 37 3
      Source/BansheeCore/Physics/BsPhysics.h
  37. 18 10
      Source/BansheeCore/Physics/BsPhysicsCommon.h
  38. 56 60
      Source/BansheeCore/Physics/BsRigidbody.h
  39. 11 17
      Source/BansheeCore/Physics/BsSliderJoint.h
  40. 12 16
      Source/BansheeCore/Physics/BsSphericalJoint.h
  41. 4 4
      Source/BansheeCore/RTTI/BsCD6JointRTTI.h
  42. 1 1
      Source/BansheeCore/Renderer/BsReflectionProbe.h
  43. 1 1
      Source/BansheeCore/Renderer/BsRendererMeshData.h
  44. 2 2
      Source/BansheeCore/Utility/BsCommonTypes.h
  45. 5 5
      Source/BansheePhysX/BsPhysX.cpp
  46. 38 38
      Source/BansheePhysX/BsPhysXD6Joint.cpp
  47. 4 4
      Source/BansheePhysX/BsPhysXD6Joint.h
  48. 9 9
      Source/BansheePhysX/BsPhysXDistanceJoint.cpp
  49. 2 2
      Source/BansheePhysX/BsPhysXDistanceJoint.h
  50. 10 10
      Source/BansheePhysX/BsPhysXHingeJoint.cpp
  51. 4 4
      Source/BansheePhysX/BsPhysXHingeJoint.h
  52. 8 8
      Source/BansheePhysX/BsPhysXRigidbody.cpp
  53. 1 1
      Source/BansheePhysX/BsPhysXRigidbody.h
  54. 5 5
      Source/BansheePhysX/BsPhysXSliderJoint.cpp
  55. 2 2
      Source/BansheePhysX/BsPhysXSliderJoint.h
  56. 5 5
      Source/BansheePhysX/BsPhysXSphericalJoint.cpp
  57. 2 2
      Source/BansheePhysX/BsPhysXSphericalJoint.h
  58. 0 7
      Source/BansheeUtility/Math/BsMath.cpp
  59. 8 8
      Source/BansheeUtility/Math/BsMath.h
  60. 2 1
      Source/BansheeUtility/Prerequisites/BsPrerequisitesUtil.h
  61. 1 1
      Source/CMakeLists.txt
  62. 1 1
      Source/MBansheeEditor/Inspectors/AudioSourceInspector.cs
  63. 2 2
      Source/MBansheeEditor/Inspectors/ColliderInspector.cs
  64. 15 12
      Source/MBansheeEditor/Inspectors/D6JointInspector.cs
  65. 18 15
      Source/MBansheeEditor/Inspectors/DistanceJointInspector.cs
  66. 26 23
      Source/MBansheeEditor/Inspectors/HingeJointInspector.cs
  67. 14 6
      Source/MBansheeEditor/Inspectors/JointInspector.cs
  68. 28 28
      Source/MBansheeEditor/Inspectors/LimitInspectors.cs
  69. 2 2
      Source/MBansheeEditor/Inspectors/RigidbodyInspector.cs
  70. 8 6
      Source/MBansheeEditor/Inspectors/SliderJointInspector.cs
  71. 8 6
      Source/MBansheeEditor/Inspectors/SphericalJointInspector.cs
  72. 2 2
      Source/MBansheeEditor/Windows/Animation/EditorAnimInfo.cs
  73. 3 3
      Source/MBansheeEditor/Windows/ColorPicker.cs
  74. 16 16
      Source/MBansheeEditor/Windows/Scene/Gizmos/JointGizmos.cs
  75. 2 2
      Source/MBansheeEditor/Windows/Scene/SceneWindow.cs
  76. 0 32
      Source/MBansheeEngine/MBansheeEngine.csproj
  77. 0 79
      Source/MBansheeEngine/Physics/BoxCollider.cs
  78. 0 133
      Source/MBansheeEngine/Physics/CapsuleCollider.cs
  79. 0 493
      Source/MBansheeEngine/Physics/CharacterController.cs
  80. 0 485
      Source/MBansheeEngine/Physics/Collider.cs
  81. 0 299
      Source/MBansheeEngine/Physics/D6Joint.cs
  82. 0 225
      Source/MBansheeEngine/Physics/DistanceJoint.cs
  83. 0 54
      Source/MBansheeEngine/Physics/FixedJoint.cs
  84. 0 184
      Source/MBansheeEngine/Physics/HingeJoint.cs
  85. 0 42
      Source/MBansheeEngine/Physics/Interop/NativeBoxCollider.cs
  86. 0 54
      Source/MBansheeEngine/Physics/Interop/NativeCapsuleCollider.cs
  87. 0 195
      Source/MBansheeEngine/Physics/Interop/NativeCharacterController.cs
  88. 0 208
      Source/MBansheeEngine/Physics/Interop/NativeCollider.cs
  89. 0 145
      Source/MBansheeEngine/Physics/Interop/NativeD6Joint.cs
  90. 0 109
      Source/MBansheeEngine/Physics/Interop/NativeDistanceJoint.cs
  91. 0 29
      Source/MBansheeEngine/Physics/Interop/NativeFixedJoint.cs
  92. 0 91
      Source/MBansheeEngine/Physics/Interop/NativeHingeJoint.cs
  93. 0 113
      Source/MBansheeEngine/Physics/Interop/NativeJoint.cs
  94. 0 49
      Source/MBansheeEngine/Physics/Interop/NativeMeshCollider.cs
  95. 0 30
      Source/MBansheeEngine/Physics/Interop/NativePlaneCollider.cs
  96. 0 377
      Source/MBansheeEngine/Physics/Interop/NativeRigidbody.cs
  97. 0 74
      Source/MBansheeEngine/Physics/Interop/NativeSliderJoint.cs
  98. 0 42
      Source/MBansheeEngine/Physics/Interop/NativeSphereCollider.cs
  99. 0 58
      Source/MBansheeEngine/Physics/Interop/NativeSphericalJoint.cs
  100. 0 1494
      Source/MBansheeEngine/Physics/Joint.cs

+ 1 - 1
Source/BansheeCore/Audio/BsAudioSource.h

@@ -13,7 +13,7 @@ namespace bs
 	 */
 	 */
 
 
 	/** Valid states in which AudioSource can be in. */
 	/** Valid states in which AudioSource can be in. */
-	enum class BS_SCRIPT_EXPORT() AudioSourceState
+	enum class BS_SCRIPT_EXPORT(m:Audio) AudioSourceState
 	{
 	{
 		Playing, /**< Source is currently playing. */
 		Playing, /**< Source is currently playing. */
 		Paused, /**< Source is currently paused (play will resume from paused point). */
 		Paused, /**< Source is currently paused (play will resume from paused point). */

+ 11 - 7
Source/BansheeCore/Components/BsCBoxCollider.h

@@ -15,30 +15,34 @@ namespace bs
 	/**
 	/**
 	 * @copydoc	BoxCollider
 	 * @copydoc	BoxCollider
 	 *
 	 *
-	 * Wraps BoxCollider as a Component.
+	 * @note Wraps BoxCollider as a Component.
 	 */
 	 */
-	class BS_CORE_EXPORT CBoxCollider : public CCollider
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:BoxCollider) CBoxCollider : public CCollider
 	{
 	{
 	public:
 	public:
 		CBoxCollider(const HSceneObject& parent, const Vector3& extents = Vector3::ONE);
 		CBoxCollider(const HSceneObject& parent, const Vector3& extents = Vector3::ONE);
 
 
 		/** @copydoc BoxCollider::setExtents */
 		/** @copydoc BoxCollider::setExtents */
+		BS_SCRIPT_EXPORT(n:Extents,pr:setter)
 		void setExtents(const Vector3& extents);
 		void setExtents(const Vector3& extents);
 
 
 		/** @copydoc BoxCollider::getExtents */
 		/** @copydoc BoxCollider::getExtents */
+		BS_SCRIPT_EXPORT(n:Extents,pr:getter)
 		Vector3 getExtents() const { return mExtents; }
 		Vector3 getExtents() const { return mExtents; }
 
 
-		/** Sets the position of the box shape, relative to the component's scene object. */
+		/** Determines the position of the box shape, relative to the component's scene object. */
+		BS_SCRIPT_EXPORT(n:Center,pr:setter)
 		void setCenter(const Vector3& center);
 		void setCenter(const Vector3& center);
 
 
-		/** Gets the position of the box shape, relative to the component's scene object. */
+		/** @copydoc setCenter() */
+		BS_SCRIPT_EXPORT(n:Center,pr:getter)
 		Vector3 getCenter() const { return mLocalPosition; }
 		Vector3 getCenter() const { return mLocalPosition; }
 
 
 		/** @name Internal
 		/** @name Internal
 		 *  @{
 		 *  @{
 		 */
 		 */
 
 
-	    /**	Returns the box collider that this component wraps. */
+		/**	Returns the box collider that this component wraps. */
 		BoxCollider* _getInternal() const { return static_cast<BoxCollider*>(mInternal.get()); }
 		BoxCollider* _getInternal() const { return static_cast<BoxCollider*>(mInternal.get()); }
 
 
 		/** @} */
 		/** @} */
@@ -52,7 +56,7 @@ namespace bs
 		/** @copydoc CCollider::createInternal */
 		/** @copydoc CCollider::createInternal */
 		SPtr<Collider> createInternal() override;
 		SPtr<Collider> createInternal() override;
 
 
-    protected:
+	protected:
 		Vector3 mExtents = Vector3::ZERO;
 		Vector3 mExtents = Vector3::ZERO;
 
 
 		/************************************************************************/
 		/************************************************************************/
@@ -65,7 +69,7 @@ namespace bs
 
 
 	protected:
 	protected:
 		CBoxCollider() {} // Serialization only
 		CBoxCollider() {} // Serialization only
-     };
+	};
 
 
 	 /** @} */
 	 /** @} */
 }
 }

+ 19 - 11
Source/BansheeCore/Components/BsCCapsuleCollider.h

@@ -15,42 +15,50 @@ namespace bs
 	/**
 	/**
 	 * @copydoc	CapsuleCollider
 	 * @copydoc	CapsuleCollider
 	 *
 	 *
-	 * Wraps CapsuleCollider as a Component.
+	 * @note Wraps CapsuleCollider as a Component.
 	 */
 	 */
-    class BS_CORE_EXPORT CCapsuleCollider : public CCollider
-    {
-    public:
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:CapsuleCollider) CCapsuleCollider : public CCollider
+	{
+	public:
 		CCapsuleCollider(const HSceneObject& parent, float radius = 1.0f, float halfHeight = 0.5f);
 		CCapsuleCollider(const HSceneObject& parent, float radius = 1.0f, float halfHeight = 0.5f);
 
 
-		/** Sets the normal vector of the capsule. It determines how is the capsule oriented. */
+		/** Normal vector that determines how is the capsule oriented. */
+		BS_SCRIPT_EXPORT(n:Normal,pr:setter)
 		void setNormal(const Vector3& normal);
 		void setNormal(const Vector3& normal);
 
 
-		/** Gets the normal vector of the capsule. It determines how is the capsule oriented. */
+		/** @copydoc setNormal() */
+		BS_SCRIPT_EXPORT(n:Normal,pr:getter)
 		Vector3 getNormal() const { return mNormal; }
 		Vector3 getNormal() const { return mNormal; }
 
 
-		/** Sets the position of the capsule shape, relative to the component's scene object. */
+		/** Determines the position of the capsule shape, relative to the component's scene object. */
+		BS_SCRIPT_EXPORT(n:Center,pr:setter)
 		void setCenter(const Vector3& center);
 		void setCenter(const Vector3& center);
 
 
-		/** Gets the position of the capsule shape, relative to the component's scene object. */
+		/** @copydoc setCenter() */
+		BS_SCRIPT_EXPORT(n:Center,pr:getter)
 		Vector3 getCenter() const { return mLocalPosition; }
 		Vector3 getCenter() const { return mLocalPosition; }
 
 
 		/** @copydoc CapsuleCollider::setHalfHeight() */
 		/** @copydoc CapsuleCollider::setHalfHeight() */
+		BS_SCRIPT_EXPORT(n:HalfHeight,pr:setter)
 		void setHalfHeight(float halfHeight);
 		void setHalfHeight(float halfHeight);
 
 
 		/** @copydoc CapsuleCollider::getHalfHeight() */
 		/** @copydoc CapsuleCollider::getHalfHeight() */
+		BS_SCRIPT_EXPORT(n:HalfHeight,pr:getter)
 		float getHalfHeight() const { return mHalfHeight; }
 		float getHalfHeight() const { return mHalfHeight; }
 
 
 		/** @copydoc CapsuleCollider::setRadius() */
 		/** @copydoc CapsuleCollider::setRadius() */
+		BS_SCRIPT_EXPORT(n:Radius,pr:setter)
 		void setRadius(float radius);
 		void setRadius(float radius);
 
 
 		/** @copydoc CapsuleCollider::getRadius() */
 		/** @copydoc CapsuleCollider::getRadius() */
+		BS_SCRIPT_EXPORT(n:Radius,pr:getter)
 		float getRadius() const { return mRadius; }
 		float getRadius() const { return mRadius; }
 
 
 		/** @name Internal
 		/** @name Internal
 		 *  @{
 		 *  @{
 		 */
 		 */
 
 
-	    /**	Returns the capsule collider that this component wraps. */
+		/**	Returns the capsule collider that this component wraps. */
 		CapsuleCollider* _getInternal() const { return static_cast<CapsuleCollider*>(mInternal.get()); }
 		CapsuleCollider* _getInternal() const { return static_cast<CapsuleCollider*>(mInternal.get()); }
 
 
 		/** @} */
 		/** @} */
@@ -64,7 +72,7 @@ namespace bs
 		/** @copydoc CCollider::createInternal */
 		/** @copydoc CCollider::createInternal */
 		SPtr<Collider> createInternal() override;
 		SPtr<Collider> createInternal() override;
 
 
-    protected:
+	protected:
 		Vector3 mNormal = Vector3::UNIT_Y;
 		Vector3 mNormal = Vector3::UNIT_Y;
 		float mRadius = 1.0f;
 		float mRadius = 1.0f;
 		float mHalfHeight = 0.5f;
 		float mHalfHeight = 0.5f;
@@ -79,7 +87,7 @@ namespace bs
 
 
 	protected:
 	protected:
 		CCapsuleCollider() {} // Serialization only
 		CCapsuleCollider() {} // Serialization only
-     };
+	};
 
 
 	 /** @} */
 	 /** @} */
 }
 }

+ 31 - 6
Source/BansheeCore/Components/BsCCharacterController.h

@@ -15,93 +15,118 @@ namespace bs
 	/**
 	/**
 	 * @copydoc	CharacterController
 	 * @copydoc	CharacterController
 	 *
 	 *
-	 * Wraps CharacterController as a Component.
+	 * @note	Wraps CharacterController as a Component.
 	 */
 	 */
-    class BS_CORE_EXPORT CCharacterController : public Component
-    {
-    public:
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:CharacterController) CCharacterController : public Component
+	{
+	public:
 		CCharacterController(const HSceneObject& parent);
 		CCharacterController(const HSceneObject& parent);
 
 
 		/** @copydoc CharacterController::move */
 		/** @copydoc CharacterController::move */
+		BS_SCRIPT_EXPORT(n:Move)
 		inline CharacterCollisionFlags move(const Vector3& displacement);
 		inline CharacterCollisionFlags move(const Vector3& displacement);
 
 
 		/** @copydoc CharacterController::getFootPosition */
 		/** @copydoc CharacterController::getFootPosition */
+		BS_SCRIPT_EXPORT(n:FootPosition,pr:getter)
 		inline Vector3 getFootPosition() const;
 		inline Vector3 getFootPosition() const;
 
 
 		/** @copydoc CharacterController::setFootPosition */
 		/** @copydoc CharacterController::setFootPosition */
+		BS_SCRIPT_EXPORT(n:FootPosition,pr:setter)
 		inline void setFootPosition(const Vector3& position);
 		inline void setFootPosition(const Vector3& position);
 
 
 		/** @copydoc CharacterController::getRadius */
 		/** @copydoc CharacterController::getRadius */
+		BS_SCRIPT_EXPORT(n:Radius,pr:getter)
 		float getRadius() const { return mDesc.radius; }
 		float getRadius() const { return mDesc.radius; }
 
 
 		/** @copydoc CharacterController::setRadius */
 		/** @copydoc CharacterController::setRadius */
+		BS_SCRIPT_EXPORT(n:Radius,pr:setter)
 		inline void setRadius(float radius);
 		inline void setRadius(float radius);
 
 
 		/** @copydoc CharacterController::getHeight */
 		/** @copydoc CharacterController::getHeight */
+		BS_SCRIPT_EXPORT(n:Height,pr:getter)
 		float getHeight() const { return mDesc.height; }
 		float getHeight() const { return mDesc.height; }
 
 
 		/** @copydoc CharacterController::setHeight */
 		/** @copydoc CharacterController::setHeight */
+		BS_SCRIPT_EXPORT(n:Height,pr:setter)
 		inline void setHeight(float height);
 		inline void setHeight(float height);
 
 
 		/** @copydoc CharacterController::getUp */
 		/** @copydoc CharacterController::getUp */
+		BS_SCRIPT_EXPORT(n:Up,pr:getter)
 		Vector3 getUp() const { return mDesc.up; }
 		Vector3 getUp() const { return mDesc.up; }
 
 
 		/** @copydoc CharacterController::setUp */
 		/** @copydoc CharacterController::setUp */
+		BS_SCRIPT_EXPORT(n:Up,pr:setter)
 		inline void setUp(const Vector3& up);
 		inline void setUp(const Vector3& up);
 
 
 		/** @copydoc CharacterController::getClimbingMode */
 		/** @copydoc CharacterController::getClimbingMode */
+		BS_SCRIPT_EXPORT(n:ClimbingMode,pr:getter)
 		CharacterClimbingMode getClimbingMode() const { return mDesc.climbingMode; }
 		CharacterClimbingMode getClimbingMode() const { return mDesc.climbingMode; }
 
 
 		/** @copydoc CharacterController::setClimbingMode */
 		/** @copydoc CharacterController::setClimbingMode */
+		BS_SCRIPT_EXPORT(n:ClimbingMode,pr:setter)
 		inline void setClimbingMode(CharacterClimbingMode mode);
 		inline void setClimbingMode(CharacterClimbingMode mode);
 
 
 		/** @copydoc CharacterController::getNonWalkableMode */
 		/** @copydoc CharacterController::getNonWalkableMode */
+		BS_SCRIPT_EXPORT(n:NonWalkableMode,pr:getter)
 		CharacterNonWalkableMode getNonWalkableMode() const { return mDesc.nonWalkableMode; }
 		CharacterNonWalkableMode getNonWalkableMode() const { return mDesc.nonWalkableMode; }
 
 
 		/** @copydoc CharacterController::setNonWalkableMode */
 		/** @copydoc CharacterController::setNonWalkableMode */
+		BS_SCRIPT_EXPORT(n:NonWalkableMode,pr:setter)
 		inline void setNonWalkableMode(CharacterNonWalkableMode mode);
 		inline void setNonWalkableMode(CharacterNonWalkableMode mode);
 
 
 		/** @copydoc CharacterController::getMinMoveDistance */
 		/** @copydoc CharacterController::getMinMoveDistance */
+		BS_SCRIPT_EXPORT(n:MinMoveDistance,pr:getter)
 		float getMinMoveDistance() const { return mDesc.minMoveDistance; }
 		float getMinMoveDistance() const { return mDesc.minMoveDistance; }
 
 
 		/** @copydoc CharacterController::setMinMoveDistance */
 		/** @copydoc CharacterController::setMinMoveDistance */
+		BS_SCRIPT_EXPORT(n:MinMoveDistance,pr:setter)
 		inline void setMinMoveDistance(float value);
 		inline void setMinMoveDistance(float value);
 
 
 		/** @copydoc CharacterController::getContactOffset */
 		/** @copydoc CharacterController::getContactOffset */
+		BS_SCRIPT_EXPORT(n:ContactOffset,pr:getter)
 		float getContactOffset() const { return mDesc.contactOffset; }
 		float getContactOffset() const { return mDesc.contactOffset; }
 
 
 		/** @copydoc CharacterController::setContactOffset */
 		/** @copydoc CharacterController::setContactOffset */
+		BS_SCRIPT_EXPORT(n:ContactOffset,pr:setter)
 		inline void setContactOffset(float value);
 		inline void setContactOffset(float value);
 
 
 		/** @copydoc CharacterController::getStepOffset */
 		/** @copydoc CharacterController::getStepOffset */
+		BS_SCRIPT_EXPORT(n:StepOffset,pr:getter)
 		inline float getStepOffset() const { return mDesc.stepOffset; }
 		inline float getStepOffset() const { return mDesc.stepOffset; }
 
 
 		/** @copydoc CharacterController::setStepOffset */
 		/** @copydoc CharacterController::setStepOffset */
+		BS_SCRIPT_EXPORT(n:StepOffset,pr:setter)
 		inline void setStepOffset(float value);
 		inline void setStepOffset(float value);
 
 
 		/** @copydoc CharacterController::getSlopeLimit */
 		/** @copydoc CharacterController::getSlopeLimit */
+		BS_SCRIPT_EXPORT(n:SlopeLimit,pr:getter)
 		Radian getSlopeLimit() const { return mDesc.slopeLimit; }
 		Radian getSlopeLimit() const { return mDesc.slopeLimit; }
 
 
 		/** @copydoc CharacterController::setSlopeLimit */
 		/** @copydoc CharacterController::setSlopeLimit */
+		BS_SCRIPT_EXPORT(n:SlopeLimit,pr:setter)
 		inline void setSlopeLimit(Radian value);
 		inline void setSlopeLimit(Radian value);
 
 
 		/** @copydoc CharacterController::getLayer */
 		/** @copydoc CharacterController::getLayer */
+		BS_SCRIPT_EXPORT(n:Layer,pr:getter)
 		UINT64 getLayer() const { return mLayer; }
 		UINT64 getLayer() const { return mLayer; }
 
 
 		/** @copydoc CharacterController::setLayer */
 		/** @copydoc CharacterController::setLayer */
+		BS_SCRIPT_EXPORT(n:Layer,pr:setter)
 		inline void setLayer(UINT64 layer);
 		inline void setLayer(UINT64 layer);
 
 
 		/** @copydoc CharacterController::onColliderHit */
 		/** @copydoc CharacterController::onColliderHit */
+		BS_SCRIPT_EXPORT(n:OnColliderHit)
 		Event<void(const ControllerColliderCollision&)> onColliderHit;
 		Event<void(const ControllerColliderCollision&)> onColliderHit;
 
 
 		/** @copydoc CharacterController::onControllerHit */
 		/** @copydoc CharacterController::onControllerHit */
+		BS_SCRIPT_EXPORT(n:OnControllerHit)
 		Event<void(const ControllerControllerCollision&)> onControllerHit;
 		Event<void(const ControllerControllerCollision&)> onControllerHit;
 
 
 		/** @name Internal
 		/** @name Internal
 		 *  @{
 		 *  @{
 		 */
 		 */
 
 
-	    /**	Returns the character controller that this component wraps. */
+		/**	Returns the character controller that this component wraps. */
 		CharacterController* _getInternal() const { return static_cast<CharacterController*>(mInternal.get()); }
 		CharacterController* _getInternal() const { return static_cast<CharacterController*>(mInternal.get()); }
 
 
 		/** @} */
 		/** @} */
@@ -157,7 +182,7 @@ namespace bs
 
 
 	protected:
 	protected:
 		CCharacterController() {} // Serialization only
 		CCharacterController() {} // Serialization only
-     };
+	 };
 
 
 	 /** @} */
 	 /** @} */
 }
 }

+ 15 - 15
Source/BansheeCore/Components/BsCCollider.cpp

@@ -290,45 +290,45 @@ namespace bs
 			mInternal->setCollisionReportMode(mode);
 			mInternal->setCollisionReportMode(mode);
 	}
 	}
 
 
-	void CCollider::triggerOnCollisionBegin(const CollisionData& data)
+	void CCollider::triggerOnCollisionBegin(const CollisionDataRaw& data)
 	{
 	{
-		// Const-cast and modify is okay because we're the only object receiving this event
-		CollisionData& hit = const_cast<CollisionData&>(data);
+		CollisionData hit;
+		hit.contactPoints = std::move(data.contactPoints);
 		hit.collider[0] = mThisHandle;
 		hit.collider[0] = mThisHandle;
 
 
-		if(hit.collidersRaw[1] != nullptr)
+		if(data.colliders[1] != nullptr)
 		{
 		{
-			CCollider* other = (CCollider*)hit.collidersRaw[1]->_getOwner(PhysicsOwnerType::Component);
+			CCollider* other = (CCollider*)data.colliders[1]->_getOwner(PhysicsOwnerType::Component);
 			hit.collider[1] = other->getHandle();
 			hit.collider[1] = other->getHandle();
 		}
 		}
 
 
 		onCollisionBegin(hit);
 		onCollisionBegin(hit);
 	}
 	}
 
 
-	void CCollider::triggerOnCollisionStay(const CollisionData& data)
+	void CCollider::triggerOnCollisionStay(const CollisionDataRaw& data)
 	{
 	{
-		// Const-cast and modify is okay because we're the only object receiving this event
-		CollisionData& hit = const_cast<CollisionData&>(data);
+		CollisionData hit;
+		hit.contactPoints = std::move(data.contactPoints);
 		hit.collider[0] = mThisHandle;
 		hit.collider[0] = mThisHandle;
 
 
-		if (hit.collidersRaw[1] != nullptr)
+		if (data.colliders[1] != nullptr)
 		{
 		{
-			CCollider* other = (CCollider*)hit.collidersRaw[1]->_getOwner(PhysicsOwnerType::Component);
+			CCollider* other = (CCollider*)data.colliders[1]->_getOwner(PhysicsOwnerType::Component);
 			hit.collider[1] = other->getHandle();
 			hit.collider[1] = other->getHandle();
 		}
 		}
 
 
 		onCollisionStay(hit);
 		onCollisionStay(hit);
 	}
 	}
 
 
-	void CCollider::triggerOnCollisionEnd(const CollisionData& data)
+	void CCollider::triggerOnCollisionEnd(const CollisionDataRaw& data)
 	{
 	{
-		// Const-cast and modify is okay because we're the only object receiving this event
-		CollisionData& hit = const_cast<CollisionData&>(data);
+		CollisionData hit;
+		hit.contactPoints = std::move(data.contactPoints);
 		hit.collider[0] = mThisHandle;
 		hit.collider[0] = mThisHandle;
 
 
-		if (hit.collidersRaw[1] != nullptr)
+		if (data.colliders[1] != nullptr)
 		{
 		{
-			CCollider* other = (CCollider*)hit.collidersRaw[1]->_getOwner(PhysicsOwnerType::Component);
+			CCollider* other = (CCollider*)data.colliders[1]->_getOwner(PhysicsOwnerType::Component);
 			hit.collider[1] = other->getHandle();
 			hit.collider[1] = other->getHandle();
 		}
 		}
 
 

+ 21 - 4
Source/BansheeCore/Components/BsCCollider.h

@@ -17,52 +17,66 @@ namespace bs
 	 *
 	 *
 	 * Wraps Collider as a Component.
 	 * Wraps Collider as a Component.
 	 */
 	 */
-	class BS_CORE_EXPORT CCollider : public Component
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:Collider) CCollider : public Component
 	{
 	{
 	public:
 	public:
 		CCollider(const HSceneObject& parent);
 		CCollider(const HSceneObject& parent);
 		virtual ~CCollider() {}
 		virtual ~CCollider() {}
 
 
 		/** @copydoc Collider::setIsTrigger */
 		/** @copydoc Collider::setIsTrigger */
+		BS_SCRIPT_EXPORT(n:Trigger,pr:setter)
 		inline void setIsTrigger(bool value);
 		inline void setIsTrigger(bool value);
 
 
 		/** @copydoc Collider::getIsTrigger */
 		/** @copydoc Collider::getIsTrigger */
+		BS_SCRIPT_EXPORT(n:Trigger,pr:getter)
 		bool getIsTrigger() const { return mIsTrigger; }
 		bool getIsTrigger() const { return mIsTrigger; }
 
 
 		/** @copydoc Collider::setMass */
 		/** @copydoc Collider::setMass */
+		BS_SCRIPT_EXPORT(n:Mass,pr:setter)
 		inline void setMass(float mass);
 		inline void setMass(float mass);
 
 
 		/** @copydoc Collider::getMass */
 		/** @copydoc Collider::getMass */
+		BS_SCRIPT_EXPORT(n:Mass,pr:getter)
 		float getMass() const { return mMass; }
 		float getMass() const { return mMass; }
 
 
 		/** @copydoc Collider::setMaterial */
 		/** @copydoc Collider::setMaterial */
+		BS_SCRIPT_EXPORT(n:Material,pr:setter)
 		inline void setMaterial(const HPhysicsMaterial& material);
 		inline void setMaterial(const HPhysicsMaterial& material);
 
 
 		/** @copydoc Collider::getMaterial */
 		/** @copydoc Collider::getMaterial */
+		BS_SCRIPT_EXPORT(n:Material,pr:getter)
 		HPhysicsMaterial getMaterial() const { return mMaterial; }
 		HPhysicsMaterial getMaterial() const { return mMaterial; }
 
 
 		/** @copydoc Collider::setContactOffset */
 		/** @copydoc Collider::setContactOffset */
+		BS_SCRIPT_EXPORT(n:ContactOffset,pr:setter)
 		inline void setContactOffset(float value);
 		inline void setContactOffset(float value);
 
 
 		/** @copydoc Collider::getContactOffset */
 		/** @copydoc Collider::getContactOffset */
+		BS_SCRIPT_EXPORT(n:ContactOffset,pr:getter)
 		float getContactOffset() const { return mContactOffset; }
 		float getContactOffset() const { return mContactOffset; }
 
 
 		/** @copydoc Collider::setRestOffset */
 		/** @copydoc Collider::setRestOffset */
+		BS_SCRIPT_EXPORT(n:RestOffset,pr:setter)
 		inline void setRestOffset(float value);
 		inline void setRestOffset(float value);
 
 
 		/** @copydoc Collider::getRestOffset */
 		/** @copydoc Collider::getRestOffset */
+		BS_SCRIPT_EXPORT(n:RestOffset,pr:getter)
 		float getRestOffset() const { return mRestOffset; }
 		float getRestOffset() const { return mRestOffset; }
 
 
 		/** @copydoc Collider::setLayer */
 		/** @copydoc Collider::setLayer */
+		BS_SCRIPT_EXPORT(n:Layer,pr:setter)
 		inline void setLayer(UINT64 layer);
 		inline void setLayer(UINT64 layer);
 
 
 		/** @copydoc Collider::getLayer */
 		/** @copydoc Collider::getLayer */
+		BS_SCRIPT_EXPORT(n:Layer,pr:getter)
 		UINT64 getLayer() const { return mLayer; }
 		UINT64 getLayer() const { return mLayer; }
 
 
 		/** @copydoc Collider::setCollisionReportMode */
 		/** @copydoc Collider::setCollisionReportMode */
+		BS_SCRIPT_EXPORT(n:CollisionReportMode,pr:setter)
 		inline void setCollisionReportMode(CollisionReportMode mode);
 		inline void setCollisionReportMode(CollisionReportMode mode);
 
 
 		/** @copydoc Collider::getCollisionReportMode */
 		/** @copydoc Collider::getCollisionReportMode */
+		BS_SCRIPT_EXPORT(n:CollisionReportMode,pr:getter)
 		CollisionReportMode getCollisionReportMode() const { return mCollisionReportMode; }
 		CollisionReportMode getCollisionReportMode() const { return mCollisionReportMode; }
 
 
 		/** @copydoc Collider::getRigidbody */
 		/** @copydoc Collider::getRigidbody */
@@ -76,12 +90,15 @@ namespace bs
 			float maxDist = FLT_MAX) const;
 			float maxDist = FLT_MAX) const;
 
 
 		/** @copydoc Collider::onCollisionBegin */
 		/** @copydoc Collider::onCollisionBegin */
+		BS_SCRIPT_EXPORT(n:OnCollisionBegin)
 		Event<void(const CollisionData&)> onCollisionBegin;
 		Event<void(const CollisionData&)> onCollisionBegin;
 
 
 		/** @copydoc Collider::onCollisionStay */
 		/** @copydoc Collider::onCollisionStay */
+		BS_SCRIPT_EXPORT(n:OnCollisionStay)
 		Event<void(const CollisionData&)> onCollisionStay;
 		Event<void(const CollisionData&)> onCollisionStay;
 
 
 		/** @copydoc Collider::onCollisionEnd */
 		/** @copydoc Collider::onCollisionEnd */
+		BS_SCRIPT_EXPORT(n:OnCollisionEnd)
 		Event<void(const CollisionData&)> onCollisionEnd;
 		Event<void(const CollisionData&)> onCollisionEnd;
 
 
 		/** @name Internal
 		/** @name Internal
@@ -154,13 +171,13 @@ namespace bs
 		void updateParentRigidbody();
 		void updateParentRigidbody();
 
 
 		/** Triggered when the internal collider begins touching another object. */
 		/** Triggered when the internal collider begins touching another object. */
-		void triggerOnCollisionBegin(const CollisionData& data);
+		void triggerOnCollisionBegin(const CollisionDataRaw& data);
 
 
 		/** Triggered when the internal collider continues touching another object. */
 		/** Triggered when the internal collider continues touching another object. */
-		void triggerOnCollisionStay(const CollisionData& data);
+		void triggerOnCollisionStay(const CollisionDataRaw& data);
 
 
 		/** Triggered when the internal collider ends touching another object. */
 		/** Triggered when the internal collider ends touching another object. */
-		void triggerOnCollisionEnd(const CollisionData& data);
+		void triggerOnCollisionEnd(const CollisionDataRaw& data);
 
 
 		SPtr<Collider> mInternal;
 		SPtr<Collider> mInternal;
 
 

+ 4 - 4
Source/BansheeCore/Components/BsCD6Joint.cpp

@@ -16,12 +16,12 @@ namespace bs
 		setName("D6Joint");
 		setName("D6Joint");
 	}
 	}
 
 
-	D6Joint::Motion CD6Joint::getMotion(D6Joint::Axis axis) const
+	D6JointMotion CD6Joint::getMotion(D6JointAxis axis) const
 	{
 	{
 		return mDesc.motion[(int)axis];
 		return mDesc.motion[(int)axis];
 	}
 	}
 
 
-	void CD6Joint::setMotion(D6Joint::Axis axis, D6Joint::Motion motion)
+	void CD6Joint::setMotion(D6JointAxis axis, D6JointMotion motion)
 	{
 	{
 		if (mDesc.motion[(int)axis] == motion)
 		if (mDesc.motion[(int)axis] == motion)
 			return;
 			return;
@@ -104,12 +104,12 @@ namespace bs
 			_getInternal()->setLimitSwing(limit);
 			_getInternal()->setLimitSwing(limit);
 	}
 	}
 
 
-	D6Joint::Drive CD6Joint::getDrive(D6Joint::DriveType type) const
+	D6JointDrive CD6Joint::getDrive(D6JointDriveType type) const
 	{
 	{
 		return mDesc.drive[(int)type];
 		return mDesc.drive[(int)type];
 	}
 	}
 
 
-	void CD6Joint::setDrive(D6Joint::DriveType type, const D6Joint::Drive& drive)
+	void CD6Joint::setDrive(D6JointDriveType type, const D6JointDrive& drive)
 	{
 	{
 		if (mDesc.drive[(int)type] == drive)
 		if (mDesc.drive[(int)type] == drive)
 			return;
 			return;

+ 29 - 10
Source/BansheeCore/Components/BsCD6Joint.h

@@ -15,75 +15,94 @@ namespace bs
 	/**
 	/**
 	 * @copydoc	D6Joint
 	 * @copydoc	D6Joint
 	 *
 	 *
-	 * Wraps D6Joint as a Component.
+	 * @note	Wraps D6Joint as a Component.
 	 */
 	 */
-    class BS_CORE_EXPORT CD6Joint : public CJoint
-    {
-    public:
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:D6Joint) CD6Joint : public CJoint
+	{
+	public:
 		CD6Joint(const HSceneObject& parent);
 		CD6Joint(const HSceneObject& parent);
 
 
 		/** @copydoc D6Joint::getMotion */
 		/** @copydoc D6Joint::getMotion */
-		inline D6Joint::Motion getMotion(D6Joint::Axis axis) const;
+		BS_SCRIPT_EXPORT(n:GetMotion)
+		inline D6JointMotion getMotion(D6JointAxis axis) const;
 
 
 		/** @copydoc D6Joint::setMotion */
 		/** @copydoc D6Joint::setMotion */
-		inline void setMotion(D6Joint::Axis axis, D6Joint::Motion motion);
+		BS_SCRIPT_EXPORT(n:SetMotion)
+		inline void setMotion(D6JointAxis axis, D6JointMotion motion);
 
 
 		/** @copydoc D6Joint::getTwist */
 		/** @copydoc D6Joint::getTwist */
+		BS_SCRIPT_EXPORT(n:Twist,pr:getter)
 		inline Radian getTwist() const;
 		inline Radian getTwist() const;
 
 
 		/** @copydoc D6Joint::getSwingY */
 		/** @copydoc D6Joint::getSwingY */
+		BS_SCRIPT_EXPORT(n:SwingY,pr:getter)
 		inline Radian getSwingY() const;
 		inline Radian getSwingY() const;
 
 
 		/** @copydoc D6Joint::getSwingZ */
 		/** @copydoc D6Joint::getSwingZ */
+		BS_SCRIPT_EXPORT(n:SwingZ,pr:getter)
 		inline Radian getSwingZ() const;
 		inline Radian getSwingZ() const;
 
 
 		/** @copydoc D6Joint::getLimitLinear */
 		/** @copydoc D6Joint::getLimitLinear */
+		BS_SCRIPT_EXPORT(n:LimitLinear,pr:getter)
 		inline LimitLinear getLimitLinear() const;
 		inline LimitLinear getLimitLinear() const;
 
 
 		/** @copydoc D6Joint::setLimitLinear */
 		/** @copydoc D6Joint::setLimitLinear */
+		BS_SCRIPT_EXPORT(n:LimitLinear,pr:setter)
 		inline void setLimitLinear(const LimitLinear& limit);
 		inline void setLimitLinear(const LimitLinear& limit);
 
 
 		/** @copydoc D6Joint::getLimitTwist */
 		/** @copydoc D6Joint::getLimitTwist */
+		BS_SCRIPT_EXPORT(n:LimitTwist,pr:getter)
 		inline LimitAngularRange getLimitTwist() const;
 		inline LimitAngularRange getLimitTwist() const;
 
 
 		/** @copydoc D6Joint::setLimitTwist */
 		/** @copydoc D6Joint::setLimitTwist */
+		BS_SCRIPT_EXPORT(n:LimitTwist,pr:setter)
 		inline void setLimitTwist(const LimitAngularRange& limit);
 		inline void setLimitTwist(const LimitAngularRange& limit);
 
 
 		/** @copydoc D6Joint::getLimitSwing */
 		/** @copydoc D6Joint::getLimitSwing */
+		BS_SCRIPT_EXPORT(n:LimitSwing,pr:getter)
 		inline LimitConeRange getLimitSwing() const;
 		inline LimitConeRange getLimitSwing() const;
 
 
 		/** @copydoc D6Joint::setLimitSwing */
 		/** @copydoc D6Joint::setLimitSwing */
+		BS_SCRIPT_EXPORT(n:LimitSwing,pr:setter)
 		inline void setLimitSwing(const LimitConeRange& limit);
 		inline void setLimitSwing(const LimitConeRange& limit);
 
 
 		/** @copydoc D6Joint::getDrive */
 		/** @copydoc D6Joint::getDrive */
-		inline D6Joint::Drive getDrive(D6Joint::DriveType type) const;
+		BS_SCRIPT_EXPORT(n:GetDrive)
+		inline D6JointDrive getDrive(D6JointDriveType type) const;
 
 
 		/** @copydoc D6Joint::setDrive */
 		/** @copydoc D6Joint::setDrive */
-		inline void setDrive(D6Joint::DriveType type, const D6Joint::Drive& drive);
+		BS_SCRIPT_EXPORT(n:SetDrive)
+		inline void setDrive(D6JointDriveType type, const D6JointDrive& drive);
 
 
 		/** @copydoc D6Joint::getDrivePosition */
 		/** @copydoc D6Joint::getDrivePosition */
+		BS_SCRIPT_EXPORT(n:DrivePosition,pr:getter)
 		inline Vector3 getDrivePosition() const;
 		inline Vector3 getDrivePosition() const;
 
 
 		/** @copydoc D6Joint::getDriveRotation */
 		/** @copydoc D6Joint::getDriveRotation */
+		BS_SCRIPT_EXPORT(n:DriveRotation,pr:getter)
 		inline Quaternion getDriveRotation() const;
 		inline Quaternion getDriveRotation() const;
 
 
 		/** @copydoc D6Joint::setDriveTransform */
 		/** @copydoc D6Joint::setDriveTransform */
+		BS_SCRIPT_EXPORT(n:SetDriveTransform)
 		inline void setDriveTransform(const Vector3& position, const Quaternion& rotation);
 		inline void setDriveTransform(const Vector3& position, const Quaternion& rotation);
 
 
 		/** @copydoc D6Joint::getDriveLinearVelocity */
 		/** @copydoc D6Joint::getDriveLinearVelocity */
+		BS_SCRIPT_EXPORT(n:DriveLinearVelocity,pr:getter)
 		inline Vector3 getDriveLinearVelocity() const;
 		inline Vector3 getDriveLinearVelocity() const;
 
 
 		/** @copydoc D6Joint::getDriveAngularVelocity */
 		/** @copydoc D6Joint::getDriveAngularVelocity */
+		BS_SCRIPT_EXPORT(n:DriveAngularVelocity,pr:getter)
 		inline Vector3 getDriveAngularVelocity() const;
 		inline Vector3 getDriveAngularVelocity() const;
 
 
 		/** @copydoc D6Joint::setDriveVelocity */
 		/** @copydoc D6Joint::setDriveVelocity */
+		BS_SCRIPT_EXPORT(n:SetDriveVelocity)
 		inline void setDriveVelocity(const Vector3& linear, const Vector3& angular);
 		inline void setDriveVelocity(const Vector3& linear, const Vector3& angular);
 
 
 		/** @name Internal
 		/** @name Internal
 		 *  @{
 		 *  @{
 		 */
 		 */
 
 
-	    /**	Returns the D6 joint that this component wraps. */
+		/**	Returns the D6 joint that this component wraps. */
 		D6Joint* _getInternal() const { return static_cast<D6Joint*>(mInternal.get()); }
 		D6Joint* _getInternal() const { return static_cast<D6Joint*>(mInternal.get()); }
 
 
 		/** @} */
 		/** @} */
@@ -109,7 +128,7 @@ namespace bs
 
 
 	protected:
 	protected:
 		CD6Joint(); // Serialization only
 		CD6Joint(); // Serialization only
-     };
+	 };
 
 
 	 /** @} */
 	 /** @} */
 }
 }

+ 4 - 4
Source/BansheeCore/Components/BsCDistanceJoint.cpp

@@ -88,22 +88,22 @@ namespace bs
 			_getInternal()->setSpring(value);
 			_getInternal()->setSpring(value);
 	}
 	}
 
 
-	void CDistanceJoint::setFlag(DistanceJoint::Flag flag, bool enabled)
+	void CDistanceJoint::setFlag(DistanceJointFlag flag, bool enabled)
 	{
 	{
 		bool isEnabled = ((UINT32)mDesc.flag & (UINT32)flag) != 0;
 		bool isEnabled = ((UINT32)mDesc.flag & (UINT32)flag) != 0;
 		if (isEnabled == enabled)
 		if (isEnabled == enabled)
 			return;
 			return;
 
 
 		if (enabled)
 		if (enabled)
-			mDesc.flag = (DistanceJoint::Flag)((UINT32)mDesc.flag | (UINT32)flag);
+			mDesc.flag = (DistanceJointFlag)((UINT32)mDesc.flag | (UINT32)flag);
 		else
 		else
-			mDesc.flag = (DistanceJoint::Flag)((UINT32)mDesc.flag & ~(UINT32)flag);
+			mDesc.flag = (DistanceJointFlag)((UINT32)mDesc.flag & ~(UINT32)flag);
 
 
 		if (mInternal != nullptr)
 		if (mInternal != nullptr)
 			_getInternal()->setFlag(flag, enabled);
 			_getInternal()->setFlag(flag, enabled);
 	}
 	}
 
 
-	bool CDistanceJoint::hasFlag(DistanceJoint::Flag flag) const
+	bool CDistanceJoint::hasFlag(DistanceJointFlag flag) const
 	{
 	{
 		return ((UINT32)mDesc.flag & (UINT32)flag) != 0;
 		return ((UINT32)mDesc.flag & (UINT32)flag) != 0;
 	}
 	}

+ 19 - 8
Source/BansheeCore/Components/BsCDistanceJoint.h

@@ -15,51 +15,62 @@ namespace bs
 	/**
 	/**
 	 * @copydoc	DistanceJoint
 	 * @copydoc	DistanceJoint
 	 *
 	 *
-	 * Wraps DistanceJoint as a Component.
+	 * @note	Wraps DistanceJoint as a Component.
 	 */
 	 */
-    class BS_CORE_EXPORT CDistanceJoint : public CJoint
-    {
-    public:
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:DistanceJoint) CDistanceJoint : public CJoint
+	{
+	public:
 		CDistanceJoint(const HSceneObject& parent);
 		CDistanceJoint(const HSceneObject& parent);
 
 
 		/** @copydoc DistanceJoint::getDistance */
 		/** @copydoc DistanceJoint::getDistance */
+		BS_SCRIPT_EXPORT(n:Distance,pr:getter)
 		inline float getDistance() const;
 		inline float getDistance() const;
 
 
 		/** @copydoc DistanceJoint::getMinDistance */
 		/** @copydoc DistanceJoint::getMinDistance */
+		BS_SCRIPT_EXPORT(n:MinDistance,pr:getter)
 		inline float getMinDistance() const;
 		inline float getMinDistance() const;
 
 
 		/** @copydoc DistanceJoint::setMinDistance */
 		/** @copydoc DistanceJoint::setMinDistance */
+		BS_SCRIPT_EXPORT(n:MinDistance,pr:setter)
 		inline void setMinDistance(float value);
 		inline void setMinDistance(float value);
 
 
 		/** @copydoc DistanceJoint::getMaxDistance */
 		/** @copydoc DistanceJoint::getMaxDistance */
+		BS_SCRIPT_EXPORT(n:MaxDistance,pr:getter)
 		inline float getMaxDistance() const;
 		inline float getMaxDistance() const;
 
 
 		/** @copydoc DistanceJoint::setMaxDistance */
 		/** @copydoc DistanceJoint::setMaxDistance */
+		BS_SCRIPT_EXPORT(n:MaxDistance,pr:setter)
 		inline void setMaxDistance(float value);
 		inline void setMaxDistance(float value);
 
 
 		/** @copydoc DistanceJoint::getTolerance */
 		/** @copydoc DistanceJoint::getTolerance */
+		BS_SCRIPT_EXPORT(n:Tolerance,pr:getter)
 		inline float getTolerance() const;
 		inline float getTolerance() const;
 
 
 		/** @copydoc DistanceJoint::setTolerance */
 		/** @copydoc DistanceJoint::setTolerance */
+		BS_SCRIPT_EXPORT(n:Tolerance,pr:setter)
 		inline void setTolerance(float value);
 		inline void setTolerance(float value);
 
 
 		/** @copydoc DistanceJoint::getSpring */
 		/** @copydoc DistanceJoint::getSpring */
+		BS_SCRIPT_EXPORT(n:Spring,pr:getter)
 		inline Spring getSpring() const;
 		inline Spring getSpring() const;
 
 
 		/** @copydoc DistanceJoint::setSpring */
 		/** @copydoc DistanceJoint::setSpring */
+		BS_SCRIPT_EXPORT(n:Spring,pr:setter)
 		inline void setSpring(const Spring& value);
 		inline void setSpring(const Spring& value);
 
 
 		/** @copydoc DistanceJoint::setFlag */
 		/** @copydoc DistanceJoint::setFlag */
-		inline void setFlag(DistanceJoint::Flag flag, bool enabled);
+		BS_SCRIPT_EXPORT(n:SetFlag)
+		inline void setFlag(DistanceJointFlag flag, bool enabled);
 
 
 		/** @copydoc DistanceJoint::hasFlag */
 		/** @copydoc DistanceJoint::hasFlag */
-		inline bool hasFlag(DistanceJoint::Flag flag) const;
+		BS_SCRIPT_EXPORT(n:HasFlag)
+		inline bool hasFlag(DistanceJointFlag flag) const;
 
 
 		/** @name Internal
 		/** @name Internal
 		 *  @{
 		 *  @{
 		 */
 		 */
 
 
-	    /**	Returns the distance joint that this component wraps. */
+		/**	Returns the distance joint that this component wraps. */
 		DistanceJoint* _getInternal() const { return static_cast<DistanceJoint*>(mInternal.get()); }
 		DistanceJoint* _getInternal() const { return static_cast<DistanceJoint*>(mInternal.get()); }
 
 
 		/** @} */
 		/** @} */
@@ -85,7 +96,7 @@ namespace bs
 
 
 	protected:
 	protected:
 		CDistanceJoint();// Serialization only
 		CDistanceJoint();// Serialization only
-     };
+	};
 
 
 	 /** @} */
 	 /** @} */
 }
 }

+ 6 - 6
Source/BansheeCore/Components/BsCFixedJoint.h

@@ -16,18 +16,18 @@ namespace bs
 	/**
 	/**
 	 * @copydoc	FixedJoint
 	 * @copydoc	FixedJoint
 	 *
 	 *
-	 * Wraps FixedJoint as a Component.
+	 * @note	Wraps FixedJoint as a Component.
 	 */
 	 */
-    class BS_CORE_EXPORT CFixedJoint : public CJoint
-    {
-    public:
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:FixedJoint) CFixedJoint : public CJoint
+	{
+	public:
 		CFixedJoint(const HSceneObject& parent);
 		CFixedJoint(const HSceneObject& parent);
 
 
 		/** @name Internal
 		/** @name Internal
 		 *  @{
 		 *  @{
 		 */
 		 */
 
 
-	    /**	Returns the fixed joint that this component wraps. */
+		/**	Returns the fixed joint that this component wraps. */
 		FixedJoint* _getInternal() const { return static_cast<FixedJoint*>(mInternal.get()); }
 		FixedJoint* _getInternal() const { return static_cast<FixedJoint*>(mInternal.get()); }
 
 
 		/** @} */
 		/** @} */
@@ -56,7 +56,7 @@ namespace bs
 
 
 	protected:
 	protected:
 		CFixedJoint(); // Serialization only
 		CFixedJoint(); // Serialization only
-     };
+	};
 
 
 	 /** @} */
 	 /** @} */
 }
 }

+ 6 - 6
Source/BansheeCore/Components/BsCHingeJoint.cpp

@@ -48,12 +48,12 @@ namespace bs
 			_getInternal()->setLimit(limit);
 			_getInternal()->setLimit(limit);
 	}
 	}
 
 
-	HingeJoint::Drive CHingeJoint::getDrive() const
+	HingeJointDrive CHingeJoint::getDrive() const
 	{
 	{
 		return mDesc.drive;
 		return mDesc.drive;
 	}
 	}
 
 
-	void CHingeJoint::setDrive(const HingeJoint::Drive& drive)
+	void CHingeJoint::setDrive(const HingeJointDrive& drive)
 	{
 	{
 		if (drive == mDesc.drive)
 		if (drive == mDesc.drive)
 			return;
 			return;
@@ -64,22 +64,22 @@ namespace bs
 			_getInternal()->setDrive(drive);
 			_getInternal()->setDrive(drive);
 	}
 	}
 
 
-	void CHingeJoint::setFlag(HingeJoint::Flag flag, bool enabled)
+	void CHingeJoint::setFlag(HingeJointFlag flag, bool enabled)
 	{
 	{
 		bool isEnabled = ((UINT32)mDesc.flag & (UINT32)flag) != 0;
 		bool isEnabled = ((UINT32)mDesc.flag & (UINT32)flag) != 0;
 		if (isEnabled == enabled)
 		if (isEnabled == enabled)
 			return;
 			return;
 
 
 		if (enabled)
 		if (enabled)
-			mDesc.flag = (HingeJoint::Flag)((UINT32)mDesc.flag | (UINT32)flag);
+			mDesc.flag = (HingeJointFlag)((UINT32)mDesc.flag | (UINT32)flag);
 		else
 		else
-			mDesc.flag = (HingeJoint::Flag)((UINT32)mDesc.flag & ~(UINT32)flag);
+			mDesc.flag = (HingeJointFlag)((UINT32)mDesc.flag & ~(UINT32)flag);
 
 
 		if (mInternal != nullptr)
 		if (mInternal != nullptr)
 			_getInternal()->setFlag(flag, enabled);
 			_getInternal()->setFlag(flag, enabled);
 	}
 	}
 
 
-	bool CHingeJoint::hasFlag(HingeJoint::Flag flag) const
+	bool CHingeJoint::hasFlag(HingeJointFlag flag) const
 	{
 	{
 		return ((UINT32)mDesc.flag & (UINT32)flag) != 0;
 		return ((UINT32)mDesc.flag & (UINT32)flag) != 0;
 	}
 	}

+ 18 - 10
Source/BansheeCore/Components/BsCHingeJoint.h

@@ -15,42 +15,50 @@ namespace bs
 	/**
 	/**
 	 * @copydoc	HingeJoint
 	 * @copydoc	HingeJoint
 	 *
 	 *
-	 * Wraps HingeJoint as a Component.
+	 * @note	Wraps HingeJoint as a Component.
 	 */
 	 */
-    class BS_CORE_EXPORT CHingeJoint : public CJoint
-    {
-    public:
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:HingeJoint) CHingeJoint : public CJoint
+	{
+	public:
 		CHingeJoint(const HSceneObject& parent);
 		CHingeJoint(const HSceneObject& parent);
 
 
 		/** @copydoc HingeJoint::getAngle */
 		/** @copydoc HingeJoint::getAngle */
+		BS_SCRIPT_EXPORT(n:Angle,pr:getter)
 		inline Radian getAngle() const;
 		inline Radian getAngle() const;
 
 
 		/** @copydoc HingeJoint::getSpeed */
 		/** @copydoc HingeJoint::getSpeed */
+		BS_SCRIPT_EXPORT(n:Speed,pr:getter)
 		inline float getSpeed() const;
 		inline float getSpeed() const;
 
 
 		/** @copydoc HingeJoint::getLimit */
 		/** @copydoc HingeJoint::getLimit */
+		BS_SCRIPT_EXPORT(n:Limit,pr:getter)
 		inline LimitAngularRange getLimit() const;
 		inline LimitAngularRange getLimit() const;
 
 
 		/** @copydoc HingeJoint::setLimit */
 		/** @copydoc HingeJoint::setLimit */
+		BS_SCRIPT_EXPORT(n:Limit,pr:setter)
 		inline void setLimit(const LimitAngularRange& limit);
 		inline void setLimit(const LimitAngularRange& limit);
 
 
 		/** @copydoc HingeJoint::getDrive */
 		/** @copydoc HingeJoint::getDrive */
-		inline HingeJoint::Drive getDrive() const;
+		BS_SCRIPT_EXPORT(n:Drive,pr:getter)
+		inline HingeJointDrive getDrive() const;
 
 
 		/** @copydoc HingeJoint::setDrive */
 		/** @copydoc HingeJoint::setDrive */
-		inline void setDrive(const HingeJoint::Drive& drive);
+		BS_SCRIPT_EXPORT(n:Drive,pr:setter)
+		inline void setDrive(const HingeJointDrive& drive);
 
 
 		/** @copydoc HingeJoint::setFlag */
 		/** @copydoc HingeJoint::setFlag */
-		inline void setFlag(HingeJoint::Flag flag, bool enabled);
+		BS_SCRIPT_EXPORT(n:SetFlag)
+		inline void setFlag(HingeJointFlag flag, bool enabled);
 
 
 		/** @copydoc HingeJoint::hasFlag */
 		/** @copydoc HingeJoint::hasFlag */
-		inline bool hasFlag(HingeJoint::Flag flag) const;
+		BS_SCRIPT_EXPORT(n:HasFlag)
+		inline bool hasFlag(HingeJointFlag flag) const;
 
 
 		/** @name Internal
 		/** @name Internal
 		 *  @{
 		 *  @{
 		 */
 		 */
 
 
-	    /**	Returns the hinge joint that this component wraps. */
+		/**	Returns the hinge joint that this component wraps. */
 		HingeJoint* _getInternal() const { return static_cast<HingeJoint*>(mInternal.get()); }
 		HingeJoint* _getInternal() const { return static_cast<HingeJoint*>(mInternal.get()); }
 
 
 		/** @} */
 		/** @} */
@@ -76,7 +84,7 @@ namespace bs
 
 
 	protected:
 	protected:
 		CHingeJoint(); // Serialization only
 		CHingeJoint(); // Serialization only
-     };
+	};
 
 
 	 /** @} */
 	 /** @} */
 }
 }

+ 18 - 6
Source/BansheeCore/Components/BsCJoint.h

@@ -15,48 +15,60 @@ namespace bs
 	/**
 	/**
 	 * @copydoc	Joint
 	 * @copydoc	Joint
 	 *
 	 *
-	 * Wraps Joint as a Component.
+	 * @note Wraps Joint as a Component.
 	 */
 	 */
-    class BS_CORE_EXPORT CJoint : public Component
-    {
-    public:
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:Joint) CJoint : public Component
+	{
+	public:
 		CJoint(const HSceneObject& parent, JOINT_DESC& desc);
 		CJoint(const HSceneObject& parent, JOINT_DESC& desc);
 		virtual ~CJoint() {}
 		virtual ~CJoint() {}
 
 
 		/** @copydoc Joint::getBody */
 		/** @copydoc Joint::getBody */
+		BS_SCRIPT_EXPORT(n:GetBody)
 		inline HRigidbody getBody(JointBody body) const;
 		inline HRigidbody getBody(JointBody body) const;
 
 
 		/** @copydoc Joint::setBody */
 		/** @copydoc Joint::setBody */
+		BS_SCRIPT_EXPORT(n:SetBody)
 		inline void setBody(JointBody body, const HRigidbody& value);
 		inline void setBody(JointBody body, const HRigidbody& value);
 
 
 		/** @copydoc Joint::getPosition */
 		/** @copydoc Joint::getPosition */
+		BS_SCRIPT_EXPORT(n:GetPosition)
 		inline Vector3 getPosition(JointBody body) const;
 		inline Vector3 getPosition(JointBody body) const;
 
 
 		/** @copydoc Joint::getRotation */
 		/** @copydoc Joint::getRotation */
+		BS_SCRIPT_EXPORT(n:GetRotation)
 		inline Quaternion getRotation(JointBody body) const;
 		inline Quaternion getRotation(JointBody body) const;
 
 
 		/** @copydoc Joint::setTransform */
 		/** @copydoc Joint::setTransform */
+		BS_SCRIPT_EXPORT(n:SetTransform)
 		inline void setTransform(JointBody body, const Vector3& position, const Quaternion& rotation);
 		inline void setTransform(JointBody body, const Vector3& position, const Quaternion& rotation);
 
 
 		/** @copydoc Joint::getBreakForce */
 		/** @copydoc Joint::getBreakForce */
+		BS_SCRIPT_EXPORT(n:BreakForce,pr:getter)
 		inline float getBreakForce() const;
 		inline float getBreakForce() const;
 
 
 		/** @copydoc Joint::setBreakForce */
 		/** @copydoc Joint::setBreakForce */
+		BS_SCRIPT_EXPORT(n:BreakForce,pr:setter)
 		inline void setBreakForce(float force);
 		inline void setBreakForce(float force);
 
 
 		/** @copydoc Joint::getBreakTorque */
 		/** @copydoc Joint::getBreakTorque */
+		BS_SCRIPT_EXPORT(n:BreakTorque,pr:getter)
 		inline float getBreakTorque() const;
 		inline float getBreakTorque() const;
 
 
 		/** @copydoc Joint::setBreakTorque */
 		/** @copydoc Joint::setBreakTorque */
+		BS_SCRIPT_EXPORT(n:BreakTorque,pr:setter)
 		inline void setBreakTorque(float torque);
 		inline void setBreakTorque(float torque);
 
 
 		/** @copydoc Joint::getEnableCollision */
 		/** @copydoc Joint::getEnableCollision */
+		BS_SCRIPT_EXPORT(n:EnableCollision,pr:getter)
 		inline bool getEnableCollision() const;
 		inline bool getEnableCollision() const;
 
 
 		/** @copydoc Joint::setEnableCollision */
 		/** @copydoc Joint::setEnableCollision */
+		BS_SCRIPT_EXPORT(n:EnableCollision,pr:setter)
 		inline void setEnableCollision(bool value);
 		inline void setEnableCollision(bool value);
 
 
 		/** @copydoc Joint::onJointBreak */
 		/** @copydoc Joint::onJointBreak */
+		BS_SCRIPT_EXPORT(n:OnJointBreak)
 		Event<void()> onJointBreak;
 		Event<void()> onJointBreak;
 
 
 		/** @name Internal
 		/** @name Internal
@@ -89,7 +101,7 @@ namespace bs
 		/** @copydoc Component::onTransformChanged() */
 		/** @copydoc Component::onTransformChanged() */
 		void onTransformChanged(TransformChangedFlags flags) override;
 		void onTransformChanged(TransformChangedFlags flags) override;
 
 
-    protected:
+	protected:
 		friend class CRigidbody;
 		friend class CRigidbody;
 		using Component::destroyInternal;
 		using Component::destroyInternal;
 
 
@@ -135,7 +147,7 @@ namespace bs
 		RTTITypeBase* getRTTI() const override;
 		RTTITypeBase* getRTTI() const override;
 
 
 		CJoint(JOINT_DESC& desc); // Serialization only
 		CJoint(JOINT_DESC& desc); // Serialization only
-     };
+	 };
 
 
 	 /** @} */
 	 /** @} */
 }
 }

+ 9 - 7
Source/BansheeCore/Components/BsCMeshCollider.h

@@ -15,24 +15,26 @@ namespace bs
 	/**
 	/**
 	 * @copydoc	MeshCollider
 	 * @copydoc	MeshCollider
 	 *
 	 *
-	 * Wraps MeshCollider as a Component.
+	 * @note Wraps MeshCollider as a Component.
 	 */
 	 */
-    class BS_CORE_EXPORT CMeshCollider : public CCollider
-    {
-    public:
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:MeshCollider) CMeshCollider : public CCollider
+	{
+	public:
 		CMeshCollider(const HSceneObject& parent);
 		CMeshCollider(const HSceneObject& parent);
 
 
 		/** @copydoc MeshCollider::setMesh */
 		/** @copydoc MeshCollider::setMesh */
+		BS_SCRIPT_EXPORT(n:Mesh,pr:setter)
 		void setMesh(const HPhysicsMesh& mesh);
 		void setMesh(const HPhysicsMesh& mesh);
 
 
 		/** @copydoc MeshCollider::getMesh */
 		/** @copydoc MeshCollider::getMesh */
+		BS_SCRIPT_EXPORT(n:Mesh,pr:getter)
 		HPhysicsMesh getMesh() const { return mMesh; }
 		HPhysicsMesh getMesh() const { return mMesh; }
 
 
 		/** @name Internal
 		/** @name Internal
 		 *  @{
 		 *  @{
 		 */
 		 */
 
 
-	    /**	Returns the mesh collider that this component wraps. */
+		/**	Returns the mesh collider that this component wraps. */
 		MeshCollider* _getInternal() const { return static_cast<MeshCollider*>(mInternal.get()); }
 		MeshCollider* _getInternal() const { return static_cast<MeshCollider*>(mInternal.get()); }
 
 
 		/** @} */
 		/** @} */
@@ -49,7 +51,7 @@ namespace bs
 		/** @copydoc CCollider::isValidParent */
 		/** @copydoc CCollider::isValidParent */
 		bool isValidParent(const HRigidbody& parent) const override;
 		bool isValidParent(const HRigidbody& parent) const override;
 
 
-    protected:
+	protected:
 		HPhysicsMesh mMesh;
 		HPhysicsMesh mMesh;
 
 
 		/************************************************************************/
 		/************************************************************************/
@@ -62,7 +64,7 @@ namespace bs
 
 
 	protected:
 	protected:
 		CMeshCollider() {} // Serialization only
 		CMeshCollider() {} // Serialization only
-     };
+	};
 
 
 	 /** @} */
 	 /** @} */
 }
 }

+ 15 - 11
Source/BansheeCore/Components/BsCPlaneCollider.h

@@ -15,30 +15,34 @@ namespace bs
 	/**
 	/**
 	 * @copydoc	PlaneCollider
 	 * @copydoc	PlaneCollider
 	 *
 	 *
-	 * Wraps PlaneCollider as a Component.
+	 * @note Wraps PlaneCollider as a Component.
 	 */
 	 */
-    class BS_CORE_EXPORT CPlaneCollider : public CCollider
-    {
-    public:
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:PlaneCollider) CPlaneCollider : public CCollider
+	{
+	public:
 		CPlaneCollider(const HSceneObject& parent);
 		CPlaneCollider(const HSceneObject& parent);
 
 
-		/** Sets the normal vector of the plane. It determines how is the plane oriented. */
+		/** Normal vector that determines the local orientation of the plane. */
+		BS_SCRIPT_EXPORT(n:Normal,pr:setter)
 		void setNormal(const Vector3& normal);
 		void setNormal(const Vector3& normal);
 
 
-		/** Gets the normal vector of the plane. It determines how is the plane oriented. */
+		/** @copydoc setNormal() */
+		BS_SCRIPT_EXPORT(n:Normal,pr:getter)
 		Vector3 getNormal() const { return mNormal; }
 		Vector3 getNormal() const { return mNormal; }
 
 
-		/** Sets the distance of the plane from the local origin, along its normal vector. */
+		/** Determines the distance of the plane from the local origin, along its normal vector. */
+		BS_SCRIPT_EXPORT(n:Distance,pr:setter)
 		void setDistance(float distance);
 		void setDistance(float distance);
 
 
-		/** Gets the distance of the plane from the local origin, along its normal vector. */
+		/** @copydoc setDistance() */
+		BS_SCRIPT_EXPORT(n:Distance,pr:getter)
 		float getDistance() const { return mDistance; }
 		float getDistance() const { return mDistance; }
 
 
 		/** @name Internal
 		/** @name Internal
 		 *  @{
 		 *  @{
 		 */
 		 */
 
 
-	    /**	Returns the plane collider that this component wraps. */
+		/**	Returns the plane collider that this component wraps. */
 		PlaneCollider* _getInternal() const { return static_cast<PlaneCollider*>(mInternal.get()); }
 		PlaneCollider* _getInternal() const { return static_cast<PlaneCollider*>(mInternal.get()); }
 
 
 		/** @} */
 		/** @} */
@@ -55,7 +59,7 @@ namespace bs
 		/** @copydoc CCollider::isValidParent */
 		/** @copydoc CCollider::isValidParent */
 		bool isValidParent(const HRigidbody& parent) const override;
 		bool isValidParent(const HRigidbody& parent) const override;
 
 
-    protected:
+	protected:
 		Vector3 mNormal = Vector3::UNIT_X;
 		Vector3 mNormal = Vector3::UNIT_X;
 		float mDistance = 0.0f;
 		float mDistance = 0.0f;
 
 
@@ -69,7 +73,7 @@ namespace bs
 
 
 	protected:
 	protected:
 		CPlaneCollider() {} // Serialization only
 		CPlaneCollider() {} // Serialization only
-     };
+	};
 
 
 	 /** @} */
 	 /** @} */
 }
 }

+ 1 - 1
Source/BansheeCore/Components/BsCReflectionProbe.h

@@ -17,7 +17,7 @@ namespace bs
 	 *
 	 *
 	 * @note	Wraps ReflectionProbe as a Component.
 	 * @note	Wraps ReflectionProbe as a Component.
 	 */
 	 */
-	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(n:ReflectionProbe) CReflectionProbe : public Component
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Rendering,n:ReflectionProbe) CReflectionProbe : public Component
 	{
 	{
 	public:
 	public:
 		CReflectionProbe(const HSceneObject& parent);
 		CReflectionProbe(const HSceneObject& parent);

+ 31 - 25
Source/BansheeCore/Components/BsCRigidbody.cpp

@@ -166,13 +166,20 @@ namespace bs
 			mInternal->setMaxAngularVelocity(maxVelocity);
 			mInternal->setMaxAngularVelocity(maxVelocity);
 	}
 	}
 
 
-	void CRigidbody::setCenterOfMass(const Vector3& position, const Quaternion& rotation)
+	void CRigidbody::setCenterOfMassPosition(const Vector3& position)
 	{
 	{
 		mCMassPosition = position;
 		mCMassPosition = position;
+
+		if (mInternal != nullptr)
+			mInternal->setCenterOfMass(position, mCMassRotation);
+	}
+
+	void CRigidbody::setCenterOfMassRotation(const Quaternion& rotation)
+	{
 		mCMassRotation = rotation;
 		mCMassRotation = rotation;
 
 
 		if (mInternal != nullptr)
 		if (mInternal != nullptr)
-			mInternal->setCenterOfMass(position, rotation);
+			mInternal->setCenterOfMass(mCMassPosition, rotation);
 	}
 	}
 
 
 	Vector3 CRigidbody::getCenterOfMassPosition() const
 	Vector3 CRigidbody::getCenterOfMassPosition() const
@@ -218,7 +225,7 @@ namespace bs
 			entry->updateCollisionReportMode();
 			entry->updateCollisionReportMode();
 	}
 	}
 
 
-	void CRigidbody::setFlags(Rigidbody::Flag flags)
+	void CRigidbody::setFlags(RigidbodyFlag flags)
 	{
 	{
 		mFlags = flags;
 		mFlags = flags;
 
 
@@ -356,18 +363,20 @@ namespace bs
 		}
 		}
 	}
 	}
 
 
-	void CRigidbody::processCollisionData(CollisionData& data)
+	void CRigidbody::processCollisionData(const CollisionDataRaw& data, CollisionData& output)
 	{
 	{
-		if (data.collidersRaw[0] != nullptr)
+		output.contactPoints = std::move(data.contactPoints);
+
+		if (data.colliders[0] != nullptr)
 		{
 		{
-			CCollider* other = (CCollider*)data.collidersRaw[0]->_getOwner(PhysicsOwnerType::Component);
-			data.collider[0] = other->getHandle();
+			CCollider* other = (CCollider*)data.colliders[0]->_getOwner(PhysicsOwnerType::Component);
+			output.collider[0] = other->getHandle();
 		}
 		}
 
 
-		if (data.collidersRaw[1] != nullptr)
+		if (data.colliders[1] != nullptr)
 		{
 		{
-			CCollider* other = (CCollider*)data.collidersRaw[1]->_getOwner(PhysicsOwnerType::Component);
-			data.collider[1] = other->getHandle();
+			CCollider* other = (CCollider*)data.colliders[1]->_getOwner(PhysicsOwnerType::Component);
+			output.collider[1] = other->getHandle();
 		}
 		}
 	}
 	}
 
 
@@ -379,29 +388,26 @@ namespace bs
 		mInternal = nullptr;
 		mInternal = nullptr;
 	}
 	}
 
 
-	void CRigidbody::triggerOnCollisionBegin(const CollisionData& data)
+	void CRigidbody::triggerOnCollisionBegin(const CollisionDataRaw& data)
 	{
 	{
-		// Const-cast and modify is okay because we're the only object receiving this event
-		CollisionData& hit = const_cast<CollisionData&>(data);
-		processCollisionData(hit);
+		CollisionData hit;
+		processCollisionData(data, hit);
 
 
 		onCollisionBegin(hit);
 		onCollisionBegin(hit);
 	}
 	}
 
 
-	void CRigidbody::triggerOnCollisionStay(const CollisionData& data)
+	void CRigidbody::triggerOnCollisionStay(const CollisionDataRaw& data)
 	{
 	{
-		// Const-cast and modify is okay because we're the only object receiving this event
-		CollisionData& hit = const_cast<CollisionData&>(data);
-		processCollisionData(hit);
+		CollisionData hit;
+		processCollisionData(data, hit);
 
 
 		onCollisionStay(hit);
 		onCollisionStay(hit);
 	}
 	}
 
 
-	void CRigidbody::triggerOnCollisionEnd(const CollisionData& data)
+	void CRigidbody::triggerOnCollisionEnd(const CollisionDataRaw& data)
 	{
 	{
-		// Const-cast and modify is okay because we're the only object receiving this event
-		CollisionData& hit = const_cast<CollisionData&>(data);
-		processCollisionData(hit);
+		CollisionData hit;
+		processCollisionData(data, hit);
 
 
 		onCollisionEnd(hit);
 		onCollisionEnd(hit);
 	}
 	}
@@ -449,7 +455,7 @@ namespace bs
 		mInternal->setIsKinematic(mIsKinematic);
 		mInternal->setIsKinematic(mIsKinematic);
 		mInternal->setFlags(mFlags);
 		mInternal->setFlags(mFlags);
 
 
-		if(((UINT32)mFlags & (UINT32)Rigidbody::Flag::AutoTensors) == 0)
+		if(((UINT32)mFlags & (UINT32)RigidbodyFlag::AutoTensors) == 0)
 		{
 		{
 			mInternal->setCenterOfMass(mCMassPosition, mCMassRotation);
 			mInternal->setCenterOfMass(mCMassPosition, mCMassRotation);
 			mInternal->setInertiaTensor(mInertiaTensor);
 			mInternal->setInertiaTensor(mInertiaTensor);
@@ -457,7 +463,7 @@ namespace bs
 		}
 		}
 		else
 		else
 		{
 		{
-			if (((UINT32)mFlags & (UINT32)Rigidbody::Flag::AutoMass) == 0)
+			if (((UINT32)mFlags & (UINT32)RigidbodyFlag::AutoMass) == 0)
 				mInternal->setMass(mMass);
 				mInternal->setMass(mMass);
 
 
 			mInternal->updateMassDistribution();
 			mInternal->updateMassDistribution();
@@ -474,7 +480,7 @@ namespace bs
 			clearColliders();
 			clearColliders();
 			updateColliders();
 			updateColliders();
 
 
-			if (((UINT32)mFlags & (UINT32)Rigidbody::Flag::AutoTensors) != 0)
+			if (((UINT32)mFlags & (UINT32)RigidbodyFlag::AutoTensors) != 0)
 				mInternal->updateMassDistribution();
 				mInternal->updateMassDistribution();
 
 
 #if BS_DEBUG_MODE
 #if BS_DEBUG_MODE

+ 64 - 15
Source/BansheeCore/Components/BsCRigidbody.h

@@ -17,142 +17,191 @@ namespace bs
 	/**
 	/**
 	 * @copydoc	Rigidbody
 	 * @copydoc	Rigidbody
 	 *
 	 *
-	 * Wraps Rigidbody as a Component. Colliders that are on the same scene object as the rigidbody, or on child scene 
-	 * objects are automatically considered as part of the rigidbody.
+	 * Colliders that are on the same scene object as the rigidbody, or on child scene objects are automatically considered
+	 * as part of the rigidbody.
+	 *
+	 * @note Wraps Rigidbody as a Component.
 	 */
 	 */
-	class BS_CORE_EXPORT CRigidbody : public Component
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:Rigidbody) CRigidbody : public Component
 	{
 	{
 	public:
 	public:
 		CRigidbody(const HSceneObject& parent);
 		CRigidbody(const HSceneObject& parent);
 
 
 		/** @copydoc Rigidbody::move */
 		/** @copydoc Rigidbody::move */
+		BS_SCRIPT_EXPORT(n:Move)
 		inline void move(const Vector3& position);
 		inline void move(const Vector3& position);
 
 
 		/** @copydoc Rigidbody::rotate */
 		/** @copydoc Rigidbody::rotate */
+		BS_SCRIPT_EXPORT(n:Rotate)
 		inline void rotate(const Quaternion& rotation);
 		inline void rotate(const Quaternion& rotation);
 
 
 		/** @copydoc Rigidbody::setMass */
 		/** @copydoc Rigidbody::setMass */
+		BS_SCRIPT_EXPORT(n:Mass,pr:setter)
 		inline void setMass(float mass);
 		inline void setMass(float mass);
 
 
 		/** @copydoc Rigidbody::getMass */
 		/** @copydoc Rigidbody::getMass */
+		BS_SCRIPT_EXPORT(n:Mass,pr:getter)
 		float getMass() const { return mMass; };
 		float getMass() const { return mMass; };
 
 
 		/** @copydoc Rigidbody::setIsKinematic */
 		/** @copydoc Rigidbody::setIsKinematic */
+		BS_SCRIPT_EXPORT(n:IsKinematic,pr:setter)
 		inline void setIsKinematic(bool kinematic);
 		inline void setIsKinematic(bool kinematic);
 
 
 		/** @copydoc Rigidbody::getIsKinematic */
 		/** @copydoc Rigidbody::getIsKinematic */
+		BS_SCRIPT_EXPORT(n:IsKinematic,pr:getter)
 		bool getIsKinematic() const { return mIsKinematic; }
 		bool getIsKinematic() const { return mIsKinematic; }
 
 
 		/** @copydoc Rigidbody::isSleeping */
 		/** @copydoc Rigidbody::isSleeping */
+		BS_SCRIPT_EXPORT(n:IsSleeping,pr:getter)
 		inline bool isSleeping() const;
 		inline bool isSleeping() const;
 
 
 		/** @copydoc Rigidbody::sleep */
 		/** @copydoc Rigidbody::sleep */
+		BS_SCRIPT_EXPORT(n:Sleep)
 		inline void sleep();
 		inline void sleep();
 
 
 		/** @copydoc Rigidbody::wakeUp */
 		/** @copydoc Rigidbody::wakeUp */
+		BS_SCRIPT_EXPORT(n:WakeUp)
 		inline void wakeUp();
 		inline void wakeUp();
 
 
 		/** @copydoc Rigidbody::setSleepThreshold */
 		/** @copydoc Rigidbody::setSleepThreshold */
+		BS_SCRIPT_EXPORT(n:SleepThreshold,pr:setter)
 		inline void setSleepThreshold(float threshold);
 		inline void setSleepThreshold(float threshold);
 
 
 		/** @copydoc Rigidbody::getSleepThreshold */
 		/** @copydoc Rigidbody::getSleepThreshold */
+		BS_SCRIPT_EXPORT(n:SleepThreshold,pr:getter)
 		float getSleepThreshold() const { return mSleepThreshold; }
 		float getSleepThreshold() const { return mSleepThreshold; }
 
 
 		/** @copydoc Rigidbody::setUseGravity */
 		/** @copydoc Rigidbody::setUseGravity */
+		BS_SCRIPT_EXPORT(n:UseGravity,pr:setter)
 		inline void setUseGravity(bool gravity);
 		inline void setUseGravity(bool gravity);
 
 
 		/** @copydoc Rigidbody::getUseGravity */
 		/** @copydoc Rigidbody::getUseGravity */
+		BS_SCRIPT_EXPORT(n:UseGravity,pr:getter)
 		bool getUseGravity() const { return mUseGravity; }
 		bool getUseGravity() const { return mUseGravity; }
 
 
 		/** @copydoc Rigidbody::setVelocity */
 		/** @copydoc Rigidbody::setVelocity */
+		BS_SCRIPT_EXPORT(n:Velocity,pr:setter)
 		inline void setVelocity(const Vector3& velocity);
 		inline void setVelocity(const Vector3& velocity);
 
 
 		/** @copydoc Rigidbody::getVelocity */
 		/** @copydoc Rigidbody::getVelocity */
+		BS_SCRIPT_EXPORT(n:Velocity,pr:getter)
 		inline Vector3 getVelocity() const;
 		inline Vector3 getVelocity() const;
 
 
 		/** @copydoc Rigidbody::setAngularVelocity */
 		/** @copydoc Rigidbody::setAngularVelocity */
+		BS_SCRIPT_EXPORT(n:AngularVelocity,pr:setter)
 		inline void setAngularVelocity(const Vector3& velocity);
 		inline void setAngularVelocity(const Vector3& velocity);
 
 
 		/** @copydoc Rigidbody::getAngularVelocity */
 		/** @copydoc Rigidbody::getAngularVelocity */
+		BS_SCRIPT_EXPORT(n:AngularVelocity,pr:getter)
 		inline Vector3 getAngularVelocity() const;
 		inline Vector3 getAngularVelocity() const;
 
 
 		/** @copydoc Rigidbody::setDrag */
 		/** @copydoc Rigidbody::setDrag */
+		BS_SCRIPT_EXPORT(n:Drag,pr:setter)
 		inline void setDrag(float drag);
 		inline void setDrag(float drag);
 
 
 		/** @copydoc Rigidbody::getDrag */
 		/** @copydoc Rigidbody::getDrag */
+		BS_SCRIPT_EXPORT(n:Drag,pr:getter)
 		float getDrag() const { return mLinearDrag; }
 		float getDrag() const { return mLinearDrag; }
 
 
 		/** @copydoc Rigidbody::setAngularDrag */
 		/** @copydoc Rigidbody::setAngularDrag */
+		BS_SCRIPT_EXPORT(n:AngularDrag,pr:setter)
 		inline void setAngularDrag(float drag);
 		inline void setAngularDrag(float drag);
 
 
 		/** @copydoc Rigidbody::getAngularDrag */
 		/** @copydoc Rigidbody::getAngularDrag */
+		BS_SCRIPT_EXPORT(n:AngularDrag,pr:getter)
 		float getAngularDrag() const { return mAngularDrag; }
 		float getAngularDrag() const { return mAngularDrag; }
 
 
 		/** @copydoc Rigidbody::setInertiaTensor */
 		/** @copydoc Rigidbody::setInertiaTensor */
+		BS_SCRIPT_EXPORT(n:InertiaTensor,pr:setter)
 		inline void setInertiaTensor(const Vector3& tensor);
 		inline void setInertiaTensor(const Vector3& tensor);
 
 
 		/** @copydoc Rigidbody::getInertiaTensor */
 		/** @copydoc Rigidbody::getInertiaTensor */
+		BS_SCRIPT_EXPORT(n:InertiaTensor,pr:getter)
 		inline Vector3 getInertiaTensor() const;
 		inline Vector3 getInertiaTensor() const;
 
 
 		/** @copydoc Rigidbody::setMaxAngularVelocity */
 		/** @copydoc Rigidbody::setMaxAngularVelocity */
+		BS_SCRIPT_EXPORT(n:MaxAngularVelocity,pr:setter)
 		inline void setMaxAngularVelocity(float maxVelocity);
 		inline void setMaxAngularVelocity(float maxVelocity);
 
 
 		/** @copydoc Rigidbody::getMaxAngularVelocity */
 		/** @copydoc Rigidbody::getMaxAngularVelocity */
+		BS_SCRIPT_EXPORT(n:MaxAngularVelocity,pr:getter)
 		float getMaxAngularVelocity() const { return mMaxAngularVelocity; }
 		float getMaxAngularVelocity() const { return mMaxAngularVelocity; }
 
 
-		/** @copydoc Rigidbody::setCenterOfMass */
-		inline void setCenterOfMass(const Vector3& position, const Quaternion& rotation);
+		/** Determines the rigidbody's center of mass position. Only relevant if RigibodyFlag::AutoTensors is turned off. */
+		BS_SCRIPT_EXPORT(n:CenterOfMassPosition,pr:setter)
+		inline void setCenterOfMassPosition(const Vector3& position);
+
+		/** @copydoc setCenterOfMassPosition() */
+		BS_SCRIPT_EXPORT(n:CenterOfMassPosition,pr:getter)
+		inline Vector3 getCenterOfMassPosition() const;
 
 
-		/** @copydoc Rigidbody::getCenterOfMassPosition */
-		inline  Vector3 getCenterOfMassPosition() const;
+		/** Determines the rigidbody's center of mass rotation. Only relevant if RigibodyFlag::AutoTensors is turned off. */
+		BS_SCRIPT_EXPORT(n:CenterOfMassRotation,pr:setter)
+		inline void setCenterOfMassRotation(const Quaternion& rotation);
 
 
-		/** @copydoc Rigidbody::getCenterOfMassRotation */
+		/** @copydoc setCenterOfMassRotation() */
+		BS_SCRIPT_EXPORT(n:CenterOfMassRotation,pr:getter)
 		inline Quaternion getCenterOfMassRotation() const;
 		inline Quaternion getCenterOfMassRotation() const;
 
 
 		/** @copydoc Rigidbody::setPositionSolverCount */
 		/** @copydoc Rigidbody::setPositionSolverCount */
+		BS_SCRIPT_EXPORT(n:PositionSolverCount,pr:setter)
 		inline void setPositionSolverCount(UINT32 count);
 		inline void setPositionSolverCount(UINT32 count);
 
 
 		/** @copydoc Rigidbody::getPositionSolverCount */
 		/** @copydoc Rigidbody::getPositionSolverCount */
+		BS_SCRIPT_EXPORT(n:PositionSolverCount,pr:getter)
 		UINT32 getPositionSolverCount() const { return mPositionSolverCount; }
 		UINT32 getPositionSolverCount() const { return mPositionSolverCount; }
 
 
 		/** @copydoc Rigidbody::setVelocitySolverCount */
 		/** @copydoc Rigidbody::setVelocitySolverCount */
+		BS_SCRIPT_EXPORT(n:VelocitySolverCount,pr:setter)
 		inline void setVelocitySolverCount(UINT32 count);
 		inline void setVelocitySolverCount(UINT32 count);
 
 
 		/** @copydoc Rigidbody::getVelocitySolverCount */
 		/** @copydoc Rigidbody::getVelocitySolverCount */
+		BS_SCRIPT_EXPORT(n:VelocitySolverCount,pr:getter)
 		UINT32 getVelocitySolverCount() const { return mVelocitySolverCount; }
 		UINT32 getVelocitySolverCount() const { return mVelocitySolverCount; }
 
 
 		/** Sets a value that determines which (if any) collision events are reported. */
 		/** Sets a value that determines which (if any) collision events are reported. */
+		BS_SCRIPT_EXPORT(n:CollisionReportMode,pr:setter)
 		inline void setCollisionReportMode(CollisionReportMode mode);
 		inline void setCollisionReportMode(CollisionReportMode mode);
 
 
 		/** Gets a value that determines which (if any) collision events are reported. */
 		/** Gets a value that determines which (if any) collision events are reported. */
+		BS_SCRIPT_EXPORT(n:CollisionReportMode,pr:getter)
 		CollisionReportMode getCollisionReportMode() const { return mCollisionReportMode; }
 		CollisionReportMode getCollisionReportMode() const { return mCollisionReportMode; }
 
 
 		/** @copydoc Rigidbody::setFlags */
 		/** @copydoc Rigidbody::setFlags */
-		inline void setFlags(Rigidbody::Flag flags);
+		BS_SCRIPT_EXPORT(n:Flags,pr:setter)
+		inline void setFlags(RigidbodyFlag flags);
 
 
 		/** @copydoc Rigidbody::getFlags */
 		/** @copydoc Rigidbody::getFlags */
-		Rigidbody::Flag getFlags() const { return mFlags; }
+		BS_SCRIPT_EXPORT(n:Flags,pr:getter)
+		RigidbodyFlag getFlags() const { return mFlags; }
 
 
 		/** @copydoc Rigidbody::addForce */
 		/** @copydoc Rigidbody::addForce */
+		BS_SCRIPT_EXPORT(n:AddForce)
 		inline void addForce(const Vector3& force, ForceMode mode = ForceMode::Force);
 		inline void addForce(const Vector3& force, ForceMode mode = ForceMode::Force);
 
 
 		/** @copydoc Rigidbody::addTorque */
 		/** @copydoc Rigidbody::addTorque */
+		BS_SCRIPT_EXPORT(n:AddTorque)
 		inline void addTorque(const Vector3& torque, ForceMode mode = ForceMode::Force);
 		inline void addTorque(const Vector3& torque, ForceMode mode = ForceMode::Force);
 
 
 		/** @copydoc Rigidbody::addForceAtPoint */
 		/** @copydoc Rigidbody::addForceAtPoint */
+		BS_SCRIPT_EXPORT(n:AddForceAtPoint)
 		inline void addForceAtPoint(const Vector3& force, const Vector3& position,
 		inline void addForceAtPoint(const Vector3& force, const Vector3& position,
 			PointForceMode mode = PointForceMode::Force);
 			PointForceMode mode = PointForceMode::Force);
 
 
 		/** @copydoc Rigidbody::getVelocityAtPoint */
 		/** @copydoc Rigidbody::getVelocityAtPoint */
+		BS_SCRIPT_EXPORT(n:GetVelocityAtPoint)
 		inline Vector3 getVelocityAtPoint(const Vector3& point) const;
 		inline Vector3 getVelocityAtPoint(const Vector3& point) const;
 
 
 		/** @copydoc Rigidbody::onCollisionBegin */
 		/** @copydoc Rigidbody::onCollisionBegin */
+		BS_SCRIPT_EXPORT(n:OnCollisionBegin)
 		Event<void(const CollisionData&)> onCollisionBegin;
 		Event<void(const CollisionData&)> onCollisionBegin;
 
 
 		/** @copydoc Rigidbody::onCollisionStay */
 		/** @copydoc Rigidbody::onCollisionStay */
+		BS_SCRIPT_EXPORT(n:OnCollisionStay)
 		Event<void(const CollisionData&)> onCollisionStay;
 		Event<void(const CollisionData&)> onCollisionStay;
 
 
 		/** @copydoc Rigidbody::onCollisionEnd */
 		/** @copydoc Rigidbody::onCollisionEnd */
+		BS_SCRIPT_EXPORT(n:OnCollisionEnd)
 		Event<void(const CollisionData&)> onCollisionEnd;
 		Event<void(const CollisionData&)> onCollisionEnd;
 
 
 		/** @name Internal
 		/** @name Internal
@@ -196,19 +245,19 @@ namespace bs
 		void checkForNestedRigibody();
 		void checkForNestedRigibody();
 
 
 		/** Appends Component referenes for the colliders to the collision data. */
 		/** Appends Component referenes for the colliders to the collision data. */
-		void processCollisionData(CollisionData& data);
+		void processCollisionData(const CollisionDataRaw& raw, CollisionData& output);
 
 
 		/** Destroys the internal rigidbody representation. */
 		/** Destroys the internal rigidbody representation. */
 		void destroyInternal();
 		void destroyInternal();
 
 
 		/** Triggered when the internal rigidbody begins touching another object. */
 		/** Triggered when the internal rigidbody begins touching another object. */
-		void triggerOnCollisionBegin(const CollisionData& data);
+		void triggerOnCollisionBegin(const CollisionDataRaw& data);
 
 
 		/** Triggered when the internal rigidbody continues touching another object. */
 		/** Triggered when the internal rigidbody continues touching another object. */
-		void triggerOnCollisionStay(const CollisionData& data);
+		void triggerOnCollisionStay(const CollisionDataRaw& data);
 
 
 		/** Triggered when the internal rigidbody ends touching another object. */
 		/** Triggered when the internal rigidbody ends touching another object. */
-		void triggerOnCollisionEnd(const CollisionData& data);
+		void triggerOnCollisionEnd(const CollisionDataRaw& data);
 
 
 		/************************************************************************/
 		/************************************************************************/
 		/* 						COMPONENT OVERRIDES                      		*/
 		/* 						COMPONENT OVERRIDES                      		*/
@@ -237,7 +286,7 @@ namespace bs
 
 
 		UINT32 mPositionSolverCount = 4;
 		UINT32 mPositionSolverCount = 4;
 		UINT32 mVelocitySolverCount = 1;
 		UINT32 mVelocitySolverCount = 1;
-		Rigidbody::Flag mFlags = (Rigidbody::Flag)((UINT32)Rigidbody::Flag::AutoTensors | (UINT32)Rigidbody::Flag::AutoMass);
+		RigidbodyFlag mFlags = (RigidbodyFlag)((UINT32)RigidbodyFlag::AutoTensors | (UINT32)RigidbodyFlag::AutoMass);
 		CollisionReportMode mCollisionReportMode = CollisionReportMode::None;
 		CollisionReportMode mCollisionReportMode = CollisionReportMode::None;
 		Vector3 mCMassPosition = Vector3::ZERO;
 		Vector3 mCMassPosition = Vector3::ZERO;
 		Quaternion mCMassRotation = Quaternion::IDENTITY;
 		Quaternion mCMassRotation = Quaternion::IDENTITY;

+ 1 - 1
Source/BansheeCore/Components/BsCSkybox.h

@@ -17,7 +17,7 @@ namespace bs
 	 *
 	 *
 	 * @note	Wraps Skybox as a Component.
 	 * @note	Wraps Skybox as a Component.
 	 */
 	 */
-	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(n:Skybox) CSkybox : public Component
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Rendering,n:Skybox) CSkybox : public Component
 	{
 	{
 	public:
 	public:
 		CSkybox(const HSceneObject& parent);
 		CSkybox(const HSceneObject& parent);

+ 4 - 4
Source/BansheeCore/Components/BsCSliderJoint.cpp

@@ -49,22 +49,22 @@ namespace bs
 			_getInternal()->setLimit(limit);
 			_getInternal()->setLimit(limit);
 	}
 	}
 
 
-	void CSliderJoint::setFlag(SliderJoint::Flag flag, bool enabled)
+	void CSliderJoint::setFlag(SliderJointFlag flag, bool enabled)
 	{
 	{
 		bool isEnabled = ((UINT32)mDesc.flag & (UINT32)flag) != 0;
 		bool isEnabled = ((UINT32)mDesc.flag & (UINT32)flag) != 0;
 		if (isEnabled == enabled)
 		if (isEnabled == enabled)
 			return;
 			return;
 
 
 		if (enabled)
 		if (enabled)
-			mDesc.flag = (SliderJoint::Flag)((UINT32)mDesc.flag | (UINT32)flag);
+			mDesc.flag = (SliderJointFlag)((UINT32)mDesc.flag | (UINT32)flag);
 		else
 		else
-			mDesc.flag = (SliderJoint::Flag)((UINT32)mDesc.flag & ~(UINT32)flag);
+			mDesc.flag = (SliderJointFlag)((UINT32)mDesc.flag & ~(UINT32)flag);
 
 
 		if (mInternal != nullptr)
 		if (mInternal != nullptr)
 			_getInternal()->setFlag(flag, enabled);
 			_getInternal()->setFlag(flag, enabled);
 	}
 	}
 
 
-	bool CSliderJoint::hasFlag(SliderJoint::Flag flag) const
+	bool CSliderJoint::hasFlag(SliderJointFlag flag) const
 	{
 	{
 		return ((UINT32)mDesc.flag & (UINT32)flag) != 0;
 		return ((UINT32)mDesc.flag & (UINT32)flag) != 0;
 	}
 	}

+ 14 - 8
Source/BansheeCore/Components/BsCSliderJoint.h

@@ -15,36 +15,42 @@ namespace bs
 	/**
 	/**
 	 * @copydoc	SliderJoint
 	 * @copydoc	SliderJoint
 	 *
 	 *
-	 * Wraps SliderJoint as a Component.
+	 * @note	Wraps SliderJoint as a Component.
 	 */
 	 */
-    class BS_CORE_EXPORT CSliderJoint : public CJoint
-    {
-    public:
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:SliderJoint) CSliderJoint : public CJoint
+	{
+	public:
 		CSliderJoint(const HSceneObject& parent);
 		CSliderJoint(const HSceneObject& parent);
 
 
 		/** @copydoc SliderJoint::getPosition */
 		/** @copydoc SliderJoint::getPosition */
+		BS_SCRIPT_EXPORT(n:Position,pr:getter)
 		inline float getPosition() const;
 		inline float getPosition() const;
 
 
 		/** @copydoc SliderJoint::getSpeed */
 		/** @copydoc SliderJoint::getSpeed */
+		BS_SCRIPT_EXPORT(n:Speed,pr:getter)
 		inline float getSpeed() const;
 		inline float getSpeed() const;
 
 
 		/** @copydoc SliderJoint::getLimit */
 		/** @copydoc SliderJoint::getLimit */
+		BS_SCRIPT_EXPORT(n:Limit,pr:getter)
 		inline LimitLinearRange getLimit() const;
 		inline LimitLinearRange getLimit() const;
 
 
 		/** @copydoc SliderJoint::setLimit */
 		/** @copydoc SliderJoint::setLimit */
+		BS_SCRIPT_EXPORT(n:Limit,pr:setter)
 		inline void setLimit(const LimitLinearRange& limit);
 		inline void setLimit(const LimitLinearRange& limit);
 
 
 		/** @copydoc SliderJoint::setFlag */
 		/** @copydoc SliderJoint::setFlag */
-		inline void setFlag(SliderJoint::Flag flag, bool enabled);
+		BS_SCRIPT_EXPORT(n:SetFlag)
+		inline void setFlag(SliderJointFlag flag, bool enabled);
 
 
 		/** @copydoc SliderJoint::hasFlag */
 		/** @copydoc SliderJoint::hasFlag */
-		inline bool hasFlag(SliderJoint::Flag flag) const;
+		BS_SCRIPT_EXPORT(n:HasFlag)
+		inline bool hasFlag(SliderJointFlag flag) const;
 
 
 		/** @name Internal
 		/** @name Internal
 		 *  @{
 		 *  @{
 		 */
 		 */
 
 
-	    /**	Returns the slider joint that this component wraps. */
+		/**	Returns the slider joint that this component wraps. */
 		SliderJoint* _getInternal() const { return static_cast<SliderJoint*>(mInternal.get()); }
 		SliderJoint* _getInternal() const { return static_cast<SliderJoint*>(mInternal.get()); }
 
 
 		/** @} */
 		/** @} */
@@ -73,7 +79,7 @@ namespace bs
 
 
 	protected:
 	protected:
 		CSliderJoint(); // Serialization only
 		CSliderJoint(); // Serialization only
-     };
+	};
 
 
 	 /** @} */
 	 /** @} */
 }
 }

+ 13 - 9
Source/BansheeCore/Components/BsCSphereCollider.h

@@ -15,30 +15,34 @@ namespace bs
 	/**
 	/**
 	 * @copydoc	SphereCollider
 	 * @copydoc	SphereCollider
 	 *
 	 *
-	 * Wraps SphereCollider as a Component.
+	 * @note Wraps SphereCollider as a Component.
 	 */
 	 */
-    class BS_CORE_EXPORT CSphereCollider : public CCollider
-    {
-    public:
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:SphereCollider) CSphereCollider : public CCollider
+	{
+	public:
 		CSphereCollider(const HSceneObject& parent, float radius = 1.0f);
 		CSphereCollider(const HSceneObject& parent, float radius = 1.0f);
 
 
 		/** @copydoc SphereCollider::setRadius */
 		/** @copydoc SphereCollider::setRadius */
+		BS_SCRIPT_EXPORT(n:Radius,pr:setter)
 		void setRadius(float radius);
 		void setRadius(float radius);
 
 
 		/** @copydoc SphereCollider::getRadius */
 		/** @copydoc SphereCollider::getRadius */
+		BS_SCRIPT_EXPORT(n:Radius,pr:getter)
 		float getRadius() const { return mRadius; }
 		float getRadius() const { return mRadius; }
 
 
-		/** Sets the position of the sphere shape, relative to the component's scene object. */
+		/** Determines position of the sphere shape, relative to the component's scene object. */
+		BS_SCRIPT_EXPORT(n:Center,pr:setter)
 		void setCenter(const Vector3& center);
 		void setCenter(const Vector3& center);
 
 
-		/** Gets the position of the sphere shape, relative to the component's scene object. */
+		/** @copydoc setCenter() */
+		BS_SCRIPT_EXPORT(n:Center,pr:getter)
 		Vector3 getCenter() const { return mLocalPosition; }
 		Vector3 getCenter() const { return mLocalPosition; }
 
 
 		/** @name Internal
 		/** @name Internal
 		 *  @{
 		 *  @{
 		 */
 		 */
 
 
-	    /**	Returns the sphere collider that this component wraps. */
+		/**	Returns the sphere collider that this component wraps. */
 		SphereCollider* _getInternal() const { return static_cast<SphereCollider*>(mInternal.get()); }
 		SphereCollider* _getInternal() const { return static_cast<SphereCollider*>(mInternal.get()); }
 
 
 		/** @} */
 		/** @} */
@@ -52,7 +56,7 @@ namespace bs
 		/** @copydoc CCollider::createInternal */
 		/** @copydoc CCollider::createInternal */
 		SPtr<Collider> createInternal() override;
 		SPtr<Collider> createInternal() override;
 
 
-    protected:
+	protected:
 		float mRadius;
 		float mRadius;
 
 
 		/************************************************************************/
 		/************************************************************************/
@@ -65,7 +69,7 @@ namespace bs
 
 
 	protected:
 	protected:
 		CSphereCollider() {} // Serialization only
 		CSphereCollider() {} // Serialization only
-     };
+	};
 
 
 	 /** @} */
 	 /** @} */
 }
 }

+ 4 - 4
Source/BansheeCore/Components/BsCSphericalJoint.cpp

@@ -32,22 +32,22 @@ namespace bs
 			_getInternal()->setLimit(limit);
 			_getInternal()->setLimit(limit);
 	}
 	}
 	
 	
-	void CSphericalJoint::setFlag(SphericalJoint::Flag flag, bool enabled)
+	void CSphericalJoint::setFlag(SphericalJointFlag flag, bool enabled)
 	{
 	{
 		bool isEnabled = ((UINT32)mDesc.flag & (UINT32)flag) != 0;
 		bool isEnabled = ((UINT32)mDesc.flag & (UINT32)flag) != 0;
 		if (isEnabled == enabled)
 		if (isEnabled == enabled)
 			return;
 			return;
 
 
 		if (enabled)
 		if (enabled)
-			mDesc.flag = (SphericalJoint::Flag)((UINT32)mDesc.flag | (UINT32)flag);
+			mDesc.flag = (SphericalJointFlag)((UINT32)mDesc.flag | (UINT32)flag);
 		else
 		else
-			mDesc.flag = (SphericalJoint::Flag)((UINT32)mDesc.flag & ~(UINT32)flag);
+			mDesc.flag = (SphericalJointFlag)((UINT32)mDesc.flag & ~(UINT32)flag);
 
 
 		if (mInternal != nullptr)
 		if (mInternal != nullptr)
 			_getInternal()->setFlag(flag, enabled);
 			_getInternal()->setFlag(flag, enabled);
 	}
 	}
 
 
-	bool CSphericalJoint::hasFlag(SphericalJoint::Flag flag) const
+	bool CSphericalJoint::hasFlag(SphericalJointFlag flag) const
 	{
 	{
 		return ((UINT32)mDesc.flag & (UINT32)flag) != 0;
 		return ((UINT32)mDesc.flag & (UINT32)flag) != 0;
 	}
 	}

+ 12 - 8
Source/BansheeCore/Components/BsCSphericalJoint.h

@@ -15,30 +15,34 @@ namespace bs
 	/**
 	/**
 	 * @copydoc	SphericalJoint
 	 * @copydoc	SphericalJoint
 	 *
 	 *
-	 * Wraps SphericalJoint as a Component.
+	 * @note	Wraps SphericalJoint as a Component.
 	 */
 	 */
-    class BS_CORE_EXPORT CSphericalJoint : public CJoint
-    {
-    public:
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:SphericalJoint) CSphericalJoint : public CJoint
+	{
+	public:
 		CSphericalJoint(const HSceneObject& parent);
 		CSphericalJoint(const HSceneObject& parent);
 
 
 		/** @copydoc SphericalJoint::getLimit */
 		/** @copydoc SphericalJoint::getLimit */
+		BS_SCRIPT_EXPORT(n:Limit,pr:getter)
 		inline LimitConeRange getLimit() const;
 		inline LimitConeRange getLimit() const;
 
 
 		/** @copydoc SphericalJoint::setLimit */
 		/** @copydoc SphericalJoint::setLimit */
+		BS_SCRIPT_EXPORT(n:Limit,pr:setter)
 		inline void setLimit(const LimitConeRange& limit);
 		inline void setLimit(const LimitConeRange& limit);
 
 
 		/** @copydoc SphericalJoint::setFlag */
 		/** @copydoc SphericalJoint::setFlag */
-		inline void setFlag(SphericalJoint::Flag flag, bool enabled);
+		BS_SCRIPT_EXPORT(n:SetFlag)
+		inline void setFlag(SphericalJointFlag flag, bool enabled);
 
 
 		/** @copydoc SphericalJoint::hasFlag */
 		/** @copydoc SphericalJoint::hasFlag */
-		inline bool hasFlag(SphericalJoint::Flag flag) const;
+		BS_SCRIPT_EXPORT(n:HasFlag)
+		inline bool hasFlag(SphericalJointFlag flag) const;
 
 
 		/** @name Internal
 		/** @name Internal
 		 *  @{
 		 *  @{
 		 */
 		 */
 
 
-	    /**	Returns the spherical joint that this component wraps. */
+		/**	Returns the spherical joint that this component wraps. */
 		SphericalJoint* _getInternal() const { return static_cast<SphericalJoint*>(mInternal.get()); }
 		SphericalJoint* _getInternal() const { return static_cast<SphericalJoint*>(mInternal.get()); }
 
 
 		/** @} */
 		/** @} */
@@ -64,7 +68,7 @@ namespace bs
 
 
 	protected:
 	protected:
 		CSphericalJoint(); // Serialization only
 		CSphericalJoint(); // Serialization only
-     };
+	};
 
 
 	 /** @} */
 	 /** @} */
 }
 }

+ 1 - 1
Source/BansheeCore/Image/BsPixelData.h

@@ -14,7 +14,7 @@ namespace bs
 	 */
 	 */
 
 
 	/** Pixel formats usable by images, textures and render surfaces. */
 	/** Pixel formats usable by images, textures and render surfaces. */
-	enum BS_SCRIPT_EXPORT() PixelFormat
+	enum BS_SCRIPT_EXPORT(m:Rendering) PixelFormat
 	{
 	{
 		/** Unknown pixel format. */
 		/** Unknown pixel format. */
 		PF_UNKNOWN				BS_SCRIPT_EXPORT(ex:true) = 0,
 		PF_UNKNOWN				BS_SCRIPT_EXPORT(ex:true) = 0,

+ 1 - 1
Source/BansheeCore/Image/BsTexture.h

@@ -15,7 +15,7 @@ namespace bs
 	 */
 	 */
 
 
 	/**	Flags that describe how is a texture used. */
 	/**	Flags that describe how is a texture used. */
-    enum BS_SCRIPT_EXPORT() TextureUsage
+    enum BS_SCRIPT_EXPORT(m:Rendering) TextureUsage
     {
     {
 		/** A regular texture that is not often or ever updated from the CPU. */
 		/** A regular texture that is not often or ever updated from the CPU. */
 		TU_STATIC			BS_SCRIPT_EXPORT(n:Default)			= GBU_STATIC, 
 		TU_STATIC			BS_SCRIPT_EXPORT(n:Default)			= GBU_STATIC, 

+ 2 - 2
Source/BansheeCore/Physics/BsCapsuleCollider.h

@@ -13,7 +13,7 @@ namespace bs
 	 *  @{
 	 *  @{
 	 */
 	 */
 
 
-	 /** Collider with a capsule geometry. */
+	/** Collider with a capsule geometry. */
 	class BS_CORE_EXPORT CapsuleCollider : public Collider
 	class BS_CORE_EXPORT CapsuleCollider : public Collider
 	{
 	{
 	public:
 	public:
@@ -31,7 +31,7 @@ namespace bs
 		/** Determines the radius of the capsule. */
 		/** Determines the radius of the capsule. */
 		virtual void setRadius(float radius) = 0;
 		virtual void setRadius(float radius) = 0;
 
 
-		/** @copydoc setRadius() .*/
+		/** @copydoc setRadius() */
 		virtual float getRadius() const = 0;
 		virtual float getRadius() const = 0;
 
 
 		/** 
 		/** 

+ 33 - 77
Source/BansheeCore/Physics/BsCharacterController.h

@@ -17,21 +17,21 @@ namespace bs
 	 * automatically climb when heights are greater than the assigned step offset. However due to the shape of the capsule
 	 * automatically climb when heights are greater than the assigned step offset. However due to the shape of the capsule
 	 * it might automatically climb over slightly larger heights than assigned step offsets.
 	 * it might automatically climb over slightly larger heights than assigned step offsets.
 	 */
 	 */
-	enum class CharacterClimbingMode
+	enum class BS_SCRIPT_EXPORT(m:Physics) CharacterClimbingMode
 	{
 	{
 		Normal, /**< Normal behaviour. Capsule character controller will be able to auto-step even above the step offset. */
 		Normal, /**< Normal behaviour. Capsule character controller will be able to auto-step even above the step offset. */
 		Constrained /**< The system will attempt to limit auto-step to the provided step offset and no higher. */
 		Constrained /**< The system will attempt to limit auto-step to the provided step offset and no higher. */
 	};
 	};
 
 
 	/** Controls behaviour when a character controller reaches a slope thats larger than its slope offset. */
 	/** Controls behaviour when a character controller reaches a slope thats larger than its slope offset. */
-	enum class CharacterNonWalkableMode
+	enum class BS_SCRIPT_EXPORT(m:Physics) CharacterNonWalkableMode
 	{
 	{
 		Prevent, /**< Character will be prevented from going further, but will be allowed to move laterally. */
 		Prevent, /**< Character will be prevented from going further, but will be allowed to move laterally. */
 		PreventAndSlide /**< Character will be prevented from going further, but also slide down the slope. */
 		PreventAndSlide /**< Character will be prevented from going further, but also slide down the slope. */
 	};
 	};
 
 
 	/** Reports in which directions is the character colliding with other objects. */
 	/** Reports in which directions is the character colliding with other objects. */
-	enum class CharacterCollisionFlag
+	enum class BS_SCRIPT_EXPORT(m:Physics) CharacterCollisionFlag
 	{
 	{
 		Sides = 0x1, /**< Character is colliding with its sides. */
 		Sides = 0x1, /**< Character is colliding with its sides. */
 		Up = 0x2, /**< Character is colliding with the ceiling. */
 		Up = 0x2, /**< Character is colliding with the ceiling. */
@@ -74,121 +74,73 @@ namespace bs
 		 */
 		 */
 		virtual void setPosition(const Vector3& position) = 0;
 		virtual void setPosition(const Vector3& position) = 0;
 
 
-		/** Returns position of the bottom of the controller. Position takes contact offset into account. */
+		/** @copydoc setFootPosition() */
 		virtual Vector3 getFootPosition() const = 0;
 		virtual Vector3 getFootPosition() const = 0;
 
 
 		/** 
 		/** 
-		 * Sets position of the bottom of the controller. Position takes contact offset into account. This will teleport the
-		 * character to the location. Use move() for movement that includes physics.
+		 * Determines the  position of the bottom of the controller. Position takes contact offset into account. Changing
+		 * this will teleport the character to the location. Use move() for movement that includes physics.
 		 */
 		 */
 		virtual void setFootPosition(const Vector3& position) = 0;
 		virtual void setFootPosition(const Vector3& position) = 0;
 
 
-		/** Returns the radius of the controller capsule. */
+		/** @copydoc setRadius() */
 		virtual float getRadius() const = 0;
 		virtual float getRadius() const = 0;
 
 
-		/** Sets the radius of the controller capsule. */
+		/** Determines the radius of the controller capsule. */
 		virtual void setRadius(float radius) = 0;
 		virtual void setRadius(float radius) = 0;
 
 
-		/** Returns the height between the centers of the two spheres of the controller capsule. */
+		/** @copydoc setHeight() */
 		virtual float getHeight() const = 0;
 		virtual float getHeight() const = 0;
 
 
-		/** Sets the height between the centers of the two spheres of the controller capsule. */
+		/** Determines the height between the centers of the two spheres of the controller capsule. */
 		virtual void setHeight(float height) = 0;
 		virtual void setHeight(float height) = 0;
 
 
-		/** Returns the up direction of capsule. Determines capsule orientation. */
+		/** @copydoc setUp() */
 		virtual Vector3 getUp() const = 0;
 		virtual Vector3 getUp() const = 0;
 
 
-		/** Sets the up direction of capsule. Determines capsule orientation. */
+		/** Determines the up direction of capsule. Determines capsule orientation. */
 		virtual void setUp(const Vector3& up) = 0;
 		virtual void setUp(const Vector3& up) = 0;
 
 
-		/** 
-		 * Returns climbing mode.
-		 *
-		 * @copydoc	CHAR_CONTROLLER_DESC::climbingMode
-		 */
+		/** @copydoc CHAR_CONTROLLER_DESC::climbingMode */
 		virtual CharacterClimbingMode getClimbingMode() const = 0;
 		virtual CharacterClimbingMode getClimbingMode() const = 0;
 
 
-		/** 
-		 * Sets climbing mode.
-		 *
-		 * @copydoc	CHAR_CONTROLLER_DESC::climbingMode
-		 */
+		/** @copydoc CHAR_CONTROLLER_DESC::climbingMode */
 		virtual void setClimbingMode(CharacterClimbingMode mode) = 0;
 		virtual void setClimbingMode(CharacterClimbingMode mode) = 0;
 
 
-		/** 
-		 * Returns non-walkable mode.
-		 *
-		 * @copydoc CHAR_CONTROLLER_DESC::nonWalkableMode
-		 */
+		/** @copydoc CHAR_CONTROLLER_DESC::nonWalkableMode */
 		virtual CharacterNonWalkableMode getNonWalkableMode() const = 0;
 		virtual CharacterNonWalkableMode getNonWalkableMode() const = 0;
 
 
-		/** 
-		 * Sets non-walkable mode.
-		 *
-		 * @copydoc CHAR_CONTROLLER_DESC::nonWalkableMode
-		 */
+		/** @copydoc CHAR_CONTROLLER_DESC::nonWalkableMode */
 		virtual void setNonWalkableMode(CharacterNonWalkableMode mode) = 0;
 		virtual void setNonWalkableMode(CharacterNonWalkableMode mode) = 0;
 
 
-		/** 
-		 * Returns minimum move distance.
-		 *
-		 * @copydoc	CHAR_CONTROLLER_DESC::minMoveDistance
-		 */
+		/** @copydoc CHAR_CONTROLLER_DESC::minMoveDistance */
 		virtual float getMinMoveDistance() const = 0;
 		virtual float getMinMoveDistance() const = 0;
 
 
-		/** 
-		 * Sets minimum move distance.
-		 *
-		 * @copydoc	CHAR_CONTROLLER_DESC::minMoveDistance
-		 */
+		/** @copydoc CHAR_CONTROLLER_DESC::minMoveDistance */
 		virtual void setMinMoveDistance(float value) = 0;
 		virtual void setMinMoveDistance(float value) = 0;
 
 
-		/** 
-		 * Returns the contact offset.
-		 *
-		 * @copydoc	CHAR_CONTROLLER_DESC::contactOffset
-		 */
+		/** @copydoc CHAR_CONTROLLER_DESC::contactOffset */
 		virtual float getContactOffset() const = 0;
 		virtual float getContactOffset() const = 0;
 
 
-		/** 
-		 * Sets the contact offset.
-		 *
-		 * @copydoc	CHAR_CONTROLLER_DESC::contactOffset
-		 */
+		/** @copydoc CHAR_CONTROLLER_DESC::contactOffset */
 		virtual void setContactOffset(float value) = 0;
 		virtual void setContactOffset(float value) = 0;
 
 
-		/** 
-		 * Returns the step offset.
-		 *
-		 * @copydoc	CHAR_CONTROLLER_DESC::stepOffset
-		 */
+		/** @copydoc CHAR_CONTROLLER_DESC::stepOffset */
 		virtual float getStepOffset() const = 0;
 		virtual float getStepOffset() const = 0;
 
 
-		/** 
-		 * Sets the step offset.
-		 *
-		 * @copydoc	CHAR_CONTROLLER_DESC::stepOffset
-		 */
+		/** @copydoc CHAR_CONTROLLER_DESC::stepOffset */
 		virtual void setStepOffset(float value) = 0;
 		virtual void setStepOffset(float value) = 0;
 
 
-		/**
-		 * Returns the slope angle.
-		 *
-		 * @copydoc	CHAR_CONTROLLER_DESC::slopeLimit
-		 */
+		/** @copydoc CHAR_CONTROLLER_DESC::slopeLimit */
 		virtual Radian getSlopeLimit() const = 0;
 		virtual Radian getSlopeLimit() const = 0;
 
 
-		/**
-		 * Sets the slope angle.
-		 *
-		 * @copydoc	CHAR_CONTROLLER_DESC::slopeLimit
-		 */
+		/** @copydoc CHAR_CONTROLLER_DESC::slopeLimit */
 		virtual void setSlopeLimit(Radian value) = 0;
 		virtual void setSlopeLimit(Radian value) = 0;
 
 
-		/** Sets the layer that controls what can the controller collide with. */
+		/** Determines the layer that controls what can the controller collide with. */
 		virtual void setLayer(UINT64 layer) { mLayer = layer; }
 		virtual void setLayer(UINT64 layer) { mLayer = layer; }
 
 
-		/** Gets the layer that controls what can the controller collide with. */
+		/** @copydoc setLayer() */
 		virtual UINT64 getLayer() const { return mLayer; }
 		virtual UINT64 getLayer() const { return mLayer; }
 
 
 		/** Creates a new character controller. */
 		/** Creates a new character controller. */
@@ -277,7 +229,7 @@ namespace bs
 	};
 	};
 
 
 	/** Contains data about a collision of a character controller and another object. */
 	/** Contains data about a collision of a character controller and another object. */
-	struct ControllerCollision
+	struct BS_SCRIPT_EXPORT(m:Physics,pl:true) ControllerCollision
 	{
 	{
 		Vector3 position; /**< Contact position. */
 		Vector3 position; /**< Contact position. */
 		Vector3 normal; /**< Contact normal. */
 		Vector3 normal; /**< Contact normal. */
@@ -286,25 +238,29 @@ namespace bs
 	};
 	};
 
 
 	/** Contains data about a collision of a character controller and a collider. */
 	/** Contains data about a collision of a character controller and a collider. */
-	struct ControllerColliderCollision : ControllerCollision
+	struct BS_SCRIPT_EXPORT(m:Physics,pl:true) ControllerColliderCollision : ControllerCollision
 	{
 	{
 		/**
 		/**
 		 * Component of the controller that was touched. Can be null if the controller has no component parent, in which 
 		 * Component of the controller that was touched. Can be null if the controller has no component parent, in which 
 		 * case check #colliderRaw. 
 		 * case check #colliderRaw. 
 		 */
 		 */
 		HCollider collider;
 		HCollider collider;
+
+		BS_SCRIPT_EXPORT(ex:true)
 		Collider* colliderRaw; /**< Collider that was touched. */
 		Collider* colliderRaw; /**< Collider that was touched. */
 		UINT32 triangleIndex; /**< Touched triangle index for mesh colliders. */
 		UINT32 triangleIndex; /**< Touched triangle index for mesh colliders. */
 	};
 	};
 
 
 	/** Contains data about a collision between two character controllers. */
 	/** Contains data about a collision between two character controllers. */
-	struct ControllerControllerCollision : ControllerCollision
+	struct BS_SCRIPT_EXPORT(m:Physics,pl:true) ControllerControllerCollision : ControllerCollision
 	{
 	{
 		/**
 		/**
 		 * Component of the controller that was touched. Can be null if the controller has no component parent, in which 
 		 * Component of the controller that was touched. Can be null if the controller has no component parent, in which 
 		 * case check #controllerRaw. 
 		 * case check #controllerRaw. 
 		 */
 		 */
 		HCharacterController controller; 
 		HCharacterController controller; 
+
+		BS_SCRIPT_EXPORT(ex:true)
 		CharacterController* controllerRaw; /**< Controller that was touched. */
 		CharacterController* controllerRaw; /**< Controller that was touched. */
 	};
 	};
 
 

+ 3 - 3
Source/BansheeCore/Physics/BsCollider.h

@@ -117,17 +117,17 @@ namespace bs
 		 * Triggered when some object starts interacting with the collider. Only triggered if proper collision report mode
 		 * Triggered when some object starts interacting with the collider. Only triggered if proper collision report mode
 		 * is turned on. 
 		 * is turned on. 
 		 */
 		 */
-		Event<void(const CollisionData&)> onCollisionBegin;
+		Event<void(const CollisionDataRaw&)> onCollisionBegin;
 		/** 
 		/** 
 		 * Triggered for every frame that an object remains interacting with a collider. Only triggered if proper collision
 		 * Triggered for every frame that an object remains interacting with a collider. Only triggered if proper collision
 		 * report mode is turned on. 
 		 * report mode is turned on. 
 		 */
 		 */
-		Event<void(const CollisionData&)> onCollisionStay;
+		Event<void(const CollisionDataRaw&)> onCollisionStay;
 		/**
 		/**
 		 * Triggered when some object stops interacting with the collider. Only triggered if proper collision report mode
 		 * Triggered when some object stops interacting with the collider. Only triggered if proper collision report mode
 		 * is turned on. 
 		 * is turned on. 
 		 */
 		 */
-		Event<void(const CollisionData&)> onCollisionEnd;
+		Event<void(const CollisionDataRaw&)> onCollisionEnd;
 
 
 		/** @name Internal
 		/** @name Internal
 		 *  @{
 		 *  @{

+ 87 - 89
Source/BansheeCore/Physics/BsD6Joint.h

@@ -13,89 +13,88 @@ namespace bs
 
 
 	struct D6_JOINT_DESC;
 	struct D6_JOINT_DESC;
 
 
-	/** 
-	 * Represents the most customizable type of joint. This joint type can be used to create all other built-in joint 
-	 * types, and to design your own custom ones, but is less intuitive to use. Allows a specification of a linear 
-	 * constraint (for example for slider), twist constraint (rotating around X) and swing constraint (rotating around Y and
-	 * Z). It also allows you to constrain limits to only specific axes or completely lock specific axes.
-	 */
-	class BS_CORE_EXPORT D6Joint : public Joint
+	/** Specifies axes that the D6 joint can constrain motion on. */
+	enum class BS_SCRIPT_EXPORT(m:Physics) D6JointAxis
 	{
 	{
-	public:
-		/** Specifies axes that the D6 joint can constrain motion on. */
-		enum class Axis
-		{
-			X, /**< Movement on the X axis. */
-			Y, /**< Movement on the Y axis. */
-			Z, /**< Movement on the Z axis. */
-			Twist, /**< Rotation around the X axis. */
-			SwingY, /**< Rotation around the Y axis. */
-			SwingZ, /**< Rotation around the Z axis. */
-			Count
-		};
-
-		/** Specifies type of constraint placed on a specific axis. */
-		enum class Motion
-		{
-			Locked, /**< Axis is immovable. */
-			Limited, /**< Axis will be constrained by the specified limits. */
-			Free, /**< Axis will not be constrained. */
-			Count
-		};
-
-		/** Type of drives that can be used for moving or rotating bodies attached to the joint. */
-		enum class DriveType
-		{
-			X, /**< Linear movement on the X axis using the linear drive model. */
-			Y, /**< Linear movement on the Y axis using the linear drive model. */
-			Z, /**< Linear movement on the Z axis using the linear drive model. */
-			/**
-			 * Rotation around the Y axis using the twist/swing angular drive model. Should not be used together with 
-			 * SLERP mode. 
-			 */
-			Swing, 
-			/** 
-			 * Rotation around the Z axis using the twist/swing angular drive model. Should not be used together with 
-			 * SLERP mode. 
-			 */
-			Twist,
-			/** 
-			 * Rotation using spherical linear interpolation. Uses the SLERP angular drive mode which performs rotation
-			 * by interpolating the quaternion values directly over the shortest path (applies to all three axes, which
-			 * they all must be unlocked).
-			 */
-			SLERP, 
-			Count
-		};
+		X, /**< Movement on the X axis. */
+		Y, /**< Movement on the Y axis. */
+		Z, /**< Movement on the Z axis. */
+		Twist, /**< Rotation around the X axis. */
+		SwingY, /**< Rotation around the Y axis. */
+		SwingZ, /**< Rotation around the Z axis. */
+		Count
+	};
+
+	/** Specifies type of constraint placed on a specific axis. */
+	enum class BS_SCRIPT_EXPORT(m:Physics) D6JointMotion
+	{
+		Locked, /**< Axis is immovable. */
+		Limited, /**< Axis will be constrained by the specified limits. */
+		Free, /**< Axis will not be constrained. */
+		Count
+	};
 
 
+	/** Type of drives that can be used for moving or rotating bodies attached to the joint. */
+	enum class BS_SCRIPT_EXPORT(m:Physics) D6JointDriveType
+	{
+		X, /**< Linear movement on the X axis using the linear drive model. */
+		Y, /**< Linear movement on the Y axis using the linear drive model. */
+		Z, /**< Linear movement on the Z axis using the linear drive model. */
+		/**
+		 * Rotation around the Y axis using the twist/swing angular drive model. Should not be used together with 
+		 * SLERP mode. 
+		 */
+		Swing, 
+		/** 
+		 * Rotation around the Z axis using the twist/swing angular drive model. Should not be used together with 
+		 * SLERP mode. 
+		 */
+		Twist,
 		/** 
 		/** 
-		 * Specifies parameters for a drive that will attempt to move the joint bodies to the specified drive position and
-		 * velocity.
+		 * Rotation using spherical linear interpolation. Uses the SLERP angular drive mode which performs rotation
+		 * by interpolating the quaternion values directly over the shortest path (applies to all three axes, which
+		 * they all must be unlocked).
 		 */
 		 */
-		struct Drive
+		SLERP, 
+		Count
+	};
+
+	/** 
+	 * Specifies parameters for a drive that will attempt to move the joint bodies to the specified drive position and
+	 * velocity.
+	 */
+	struct BS_SCRIPT_EXPORT(m:Physics,pl:true) D6JointDrive
+	{
+		bool operator==(const D6JointDrive& other) const
 		{
 		{
-			bool operator==(const Drive& other) const
-			{
-				return stiffness == other.stiffness && damping == other.damping && forceLimit == other.forceLimit &&
-					acceleration == other.acceleration;
-			}
+			return stiffness == other.stiffness && damping == other.damping && forceLimit == other.forceLimit &&
+				acceleration == other.acceleration;
+		}
 
 
-			/** Spring strength. Force proportional to the position error. */
-			float stiffness = 0.0f;
+		/** Spring strength. Force proportional to the position error. */
+		float stiffness = 0.0f;
 
 
-			/** Damping strength. Force propertional to the velocity error. */
-			float damping = 0.0f;
+		/** Damping strength. Force propertional to the velocity error. */
+		float damping = 0.0f;
 
 
-			/** Maximum force the drive can apply. */
-			float forceLimit = FLT_MAX;
+		/** Maximum force the drive can apply. */
+		float forceLimit = FLT_MAX;
 
 
-			/** 
-			 * If true the drive will generate acceleration instead of forces. Acceleration drives are easier to tune as
-			 * they account for the masses of the actors to which the joint is attached.
-			 */
-			bool acceleration = false;
-		};
+		/** 
+		 * If true the drive will generate acceleration instead of forces. Acceleration drives are easier to tune as
+		 * they account for the masses of the actors to which the joint is attached.
+		 */
+		bool acceleration = false;
+	};
 
 
+	/** 
+	 * Represents the most customizable type of joint. This joint type can be used to create all other built-in joint 
+	 * types, and to design your own custom ones, but is less intuitive to use. Allows a specification of a linear 
+	 * constraint (for example for slider), twist constraint (rotating around X) and swing constraint (rotating around Y and
+	 * Z). It also allows you to constrain limits to only specific axes or completely lock specific axes.
+	 */
+	class BS_CORE_EXPORT D6Joint : public Joint
+	{
 	public:
 	public:
 		D6Joint(const D6_JOINT_DESC& desc) { }
 		D6Joint(const D6_JOINT_DESC& desc) { }
 		virtual ~D6Joint() { }
 		virtual ~D6Joint() { }
@@ -105,7 +104,7 @@ namespace bs
 		 *
 		 *
 		 * @see	setMotion
 		 * @see	setMotion
 		 */
 		 */
-		virtual Motion getMotion(Axis axis) const = 0;
+		virtual D6JointMotion getMotion(D6JointAxis axis) const = 0;
 
 
 		/** 
 		/** 
 		 * Allows you to constrain motion of the specified axis. Be aware that when setting drives for a specific axis
 		 * Allows you to constrain motion of the specified axis. Be aware that when setting drives for a specific axis
@@ -124,7 +123,7 @@ namespace bs
 		 *    attached at the elbow)
 		 *    attached at the elbow)
 		 *  - If all angular degrees of freedom are unlocked the result is the same as the spherical joint.
 		 *  - If all angular degrees of freedom are unlocked the result is the same as the spherical joint.
 		 */
 		 */
-		virtual void setMotion(Axis axis, Motion motion) = 0;
+		virtual void setMotion(D6JointAxis axis, D6JointMotion motion) = 0;
 
 
 		/** Returns the current rotation of the joint around the X axis. */
 		/** Returns the current rotation of the joint around the X axis. */
 		virtual Radian getTwist() const = 0;
 		virtual Radian getTwist() const = 0;
@@ -135,33 +134,32 @@ namespace bs
 		/** Returns the current rotation of the joint around the Z axis. */
 		/** Returns the current rotation of the joint around the Z axis. */
 		virtual Radian getSwingZ() const = 0;
 		virtual Radian getSwingZ() const = 0;
 
 
-		/** Returns the linear limit used for constraining translation degrees of freedom. */
+		/** @copydoc setLimitLinear() */
 		virtual LimitLinear getLimitLinear() const = 0;
 		virtual LimitLinear getLimitLinear() const = 0;
 
 
-		/** Sets the linear limit used for constraining translation degrees of freedom. */
+		/** Determines the linear limit used for constraining translation degrees of freedom. */
 		virtual void setLimitLinear(const LimitLinear& limit) = 0;
 		virtual void setLimitLinear(const LimitLinear& limit) = 0;
 		
 		
-		/** Returns the angular limit used for constraining the twist (rotation around X) degree of freedom. */
+		/** @copydoc setLimitTwist() */
 		virtual LimitAngularRange getLimitTwist() const = 0;
 		virtual LimitAngularRange getLimitTwist() const = 0;
 
 
-		/** Sets the angular limit used for constraining the twist (rotation around X) degree of freedom. */
+		/** Determines the angular limit used for constraining the twist (rotation around X) degree of freedom. */
 		virtual void setLimitTwist(const LimitAngularRange& limit) = 0;
 		virtual void setLimitTwist(const LimitAngularRange& limit) = 0;
 
 
-		/** Returns the cone limit used for constraining the swing (rotation around Y and Z) degree of freedom. */
+		/** @copydoc setLimitSwing() */
 		virtual LimitConeRange getLimitSwing() const = 0;
 		virtual LimitConeRange getLimitSwing() const = 0;
 
 
-		/** Sets the cone limit used for constraining the swing (rotation around Y and Z) degree of freedom. */
+		/** Determines the cone limit used for constraining the swing (rotation around Y and Z) degree of freedom. */
 		virtual void setLimitSwing(const LimitConeRange& limit) = 0;
 		virtual void setLimitSwing(const LimitConeRange& limit) = 0;
 	
 	
-		/**
-		 * Returns a drive that will attempt to move the specified degree(s) of freedom to the wanted position and velocity. 
-		 */
-		virtual Drive getDrive(DriveType type) const = 0;
+		/** @copydoc setDrive() */
+		virtual D6JointDrive getDrive(D6JointDriveType type) const = 0;
 
 
 		/**
 		/**
-		 * Sets a drive that will attempt to move the specified degree(s) of freedom to the wanted position and velocity. 
+		 * Determines a drive that will attempt to move the specified degree(s) of freedom to the wanted position and
+		 * velocity. 
 		 */
 		 */
-		virtual void setDrive(DriveType type, const Drive& drive) = 0;
+		virtual void setDrive(D6JointDriveType type, const D6JointDrive& drive) = 0;
 
 
 		/** Returns the drive's target position relative to the joint's first body. */
 		/** Returns the drive's target position relative to the joint's first body. */
 		virtual Vector3 getDrivePosition() const = 0;
 		virtual Vector3 getDrivePosition() const = 0;
@@ -190,8 +188,8 @@ namespace bs
 	{
 	{
 		D6_JOINT_DESC() { }
 		D6_JOINT_DESC() { }
 
 
-		D6Joint::Motion motion[(UINT32)D6Joint::Axis::Count];
-		D6Joint::Drive drive[(UINT32)D6Joint::DriveType::Count];
+		D6JointMotion motion[(UINT32)D6JointAxis::Count];
+		D6JointDrive drive[(UINT32)D6JointDriveType::Count];
 		LimitLinear limitLinear;
 		LimitLinear limitLinear;
 		LimitAngularRange limitTwist;
 		LimitAngularRange limitTwist;
 		LimitConeRange limitSwing;
 		LimitConeRange limitSwing;

+ 20 - 35
Source/BansheeCore/Physics/BsDistanceJoint.h

@@ -13,18 +13,17 @@ namespace bs
 
 
 	struct DISTANCE_JOINT_DESC;
 	struct DISTANCE_JOINT_DESC;
 
 
+	/** Controls distance joint options. */
+	enum class BS_SCRIPT_EXPORT(m:Physics) DistanceJointFlag
+	{
+		MinDistance = 0x1, /**< Enables minimum distance limit. */
+		MaxDistance = 0x2, /**< Enables maximum distance limit. */
+		Spring = 0x4 /**< Enables spring when maintaining limits. */
+	};
+
 	/** A joint that maintains an upper or lower (or both) bound on the distance between two bodies. */
 	/** A joint that maintains an upper or lower (or both) bound on the distance between two bodies. */
 	class BS_CORE_EXPORT DistanceJoint : public Joint
 	class BS_CORE_EXPORT DistanceJoint : public Joint
 	{
 	{
-	public:
-		/** Controls distance joint options. */
-		enum class Flag
-		{
-			MinDistance = 0x1, /**< Enables minimum distance limit. */
-			MaxDistance = 0x2, /**< Enables maximum distance limit. */
-			Spring = 0x4 /**< Enables spring when maintaining limits. */
-		};
-
 	public:
 	public:
 		DistanceJoint(const DISTANCE_JOINT_DESC& desc) { }
 		DistanceJoint(const DISTANCE_JOINT_DESC& desc) { }
 		virtual ~DistanceJoint() { }
 		virtual ~DistanceJoint() { }
@@ -32,63 +31,49 @@ namespace bs
 		/** Returns the current distance between the two joint bodies. */
 		/** Returns the current distance between the two joint bodies. */
 		virtual float getDistance() const = 0;
 		virtual float getDistance() const = 0;
 
 
-		/**
-		 * Returns the minimum distance the bodies are allowed to be at, they will get no closer. You must enable min
-		 * distance flag in order for this limit to be applied.
-		 */
+		/** @copydoc setMinDistance() */
 		virtual float getMinDistance() const = 0;
 		virtual float getMinDistance() const = 0;
 
 
 		/**
 		/**
-		 * Sets the minimum distance the bodies are allowed to be at, they will get no closer. You must enable min
+		 * Determines the minimum distance the bodies are allowed to be at, they will get no closer. You must enable min
 		 * distance flag in order for this limit to be applied.
 		 * distance flag in order for this limit to be applied.
 		 */
 		 */
 		virtual void setMinDistance(float value) = 0;
 		virtual void setMinDistance(float value) = 0;
 
 
-		/**
-		 * Returns the maximum distance the bodies are allowed to be at, they will get no further. You must enable max
-		 * distance flag in order for this limit to be applied.
-		 */
+		/** @copydoc setMaxDistance() */
 		virtual float getMaxDistance() const = 0;
 		virtual float getMaxDistance() const = 0;
 
 
 		/**
 		/**
-		 * Sets the maximum distance the bodies are allowed to be at, they will get no further. You must enable max
+		 * Determines the maximum distance the bodies are allowed to be at, they will get no further. You must enable max
 		 * distance flag in order for this limit to be applied.
 		 * distance flag in order for this limit to be applied.
 		 */
 		 */
 		virtual void setMaxDistance(float value) = 0;
 		virtual void setMaxDistance(float value) = 0;
 
 
-		/**
-		 * Returns the error tolerance of the joint at which the joint becomes active. This value slightly extends the
-		 * lower and upper limit. 
-		 */
+		/** @copydoc setTolerance() */
 		virtual float getTolerance() const = 0;
 		virtual float getTolerance() const = 0;
 
 
 		/**
 		/**
-		 * Sets the error tolerance of the joint at which the joint becomes active. This value slightly extends the
+		 * Determines the error tolerance of the joint at which the joint becomes active. This value slightly extends the
 		 * lower and upper limit. 
 		 * lower and upper limit. 
 		 */
 		 */
 		virtual void setTolerance(float value) = 0;
 		virtual void setTolerance(float value) = 0;
 
 
-		/**
-		 * Returns a spring that controls how the joint responds when a limit is reached. You must enable the spring flag
-		 * on the joint in order for this to be recognized. 
-		 * 
-		 * @see	Spring
-		 */
+		/** @copydoc setSpring() */
 		virtual Spring getSpring() const = 0;
 		virtual Spring getSpring() const = 0;
 
 
 		/**
 		/**
-		 * Sets a spring that controls how the joint responds when a limit is reached. You must enable the spring flag on
-		 * the joint in order for this to be recognized. 
+		 * Determines a spring that controls how the joint responds when a limit is reached. You must enable the spring 
+		 * flag on the joint in order for this to be recognized. 
 		 * 
 		 * 
 		 * @see	Spring
 		 * @see	Spring
 		 */
 		 */
 		virtual void setSpring(const Spring& value) = 0;
 		virtual void setSpring(const Spring& value) = 0;
 
 
 		/** Enables or disables a flag that controls joint behaviour. */
 		/** Enables or disables a flag that controls joint behaviour. */
-		virtual void setFlag(Flag flag, bool enabled) = 0;
+		virtual void setFlag(DistanceJointFlag flag, bool enabled) = 0;
 
 
 		/** Checks whether a certain joint flag is enabled. */
 		/** Checks whether a certain joint flag is enabled. */
-		virtual bool hasFlag(Flag flag) const = 0;
+		virtual bool hasFlag(DistanceJointFlag flag) const = 0;
 
 
 		/** Creates a new distance joint. */
 		/** Creates a new distance joint. */
 		static SPtr<DistanceJoint> create(const DISTANCE_JOINT_DESC& desc);
 		static SPtr<DistanceJoint> create(const DISTANCE_JOINT_DESC& desc);
@@ -101,7 +86,7 @@ namespace bs
 		float maxDistance = 0.0f;
 		float maxDistance = 0.0f;
 		float tolerance = 0.25f;
 		float tolerance = 0.25f;
 		Spring spring;
 		Spring spring;
-		DistanceJoint::Flag flag = (DistanceJoint::Flag)0;
+		DistanceJointFlag flag = (DistanceJointFlag)0;
 	};
 	};
 
 
 	/** @} */
 	/** @} */

+ 9 - 15
Source/BansheeCore/Physics/BsFJoint.h

@@ -13,7 +13,7 @@ namespace bs
 	 */
 	 */
 
 
 	/** Specifies first or second body referenced by a Joint. */
 	/** Specifies first or second body referenced by a Joint. */
-	enum class JointBody
+	enum class BS_SCRIPT_EXPORT(m:Physics) JointBody
 	{
 	{
 		Target, /**< Body the joint is influencing. */
 		Target, /**< Body the joint is influencing. */
 		Anchor /**< Body the joint is attached to (if any). */
 		Anchor /**< Body the joint is attached to (if any). */
@@ -31,10 +31,10 @@ namespace bs
 		FJoint(const JOINT_DESC& desc) { }
 		FJoint(const JOINT_DESC& desc) { }
 		virtual ~FJoint() { }
 		virtual ~FJoint() { }
 
 
-		/** Returns one of the bodies managed by the joint. */
+		/** @copydoc setBody() */
 		virtual Rigidbody* getBody(JointBody body) const = 0;
 		virtual Rigidbody* getBody(JointBody body) const = 0;
 
 
-		/** Sets a body managed by the joint. One of the bodies must be movable (non-kinematic). */
+		/** Determines a body managed by the joint. One of the bodies must be movable (non-kinematic). */
 		virtual void setBody(JointBody body, Rigidbody* value) = 0;
 		virtual void setBody(JointBody body, Rigidbody* value) = 0;
 
 
 		/** Returns the position relative to the body, at which the body is anchored to the joint. */
 		/** Returns the position relative to the body, at which the body is anchored to the joint. */
@@ -46,34 +46,28 @@ namespace bs
 		/** Sets the position and rotation relative to the body, at which the body is anchored to the joint.  */
 		/** Sets the position and rotation relative to the body, at which the body is anchored to the joint.  */
 		virtual void setTransform(JointBody body, const Vector3& position, const Quaternion& rotation) = 0;
 		virtual void setTransform(JointBody body, const Vector3& position, const Quaternion& rotation) = 0;
 
 
-		/** 
-		 * Returns the maximum force the joint can apply before breaking. Broken joints no longer participate in physics 
-		 * simulation. 
-		 */
+		/** @copydoc setBreakForce() */
 		virtual float getBreakForce() const = 0;
 		virtual float getBreakForce() const = 0;
 
 
 		/** 
 		/** 
-		 * Sets the maximum force the joint can apply before breaking. Broken joints no longer participate in physics 
+		 * Determines the maximum force the joint can apply before breaking. Broken joints no longer participate in physics 
 		 * simulation. 
 		 * simulation. 
 		 */
 		 */
 		virtual void setBreakForce(float force) = 0;
 		virtual void setBreakForce(float force) = 0;
 
 
-		/** 
-		 * Returns the maximum torque the joint can apply before breaking. Broken joints no longer participate in physics 
-		 * simulation. 
-		 */
+		/** @copydoc setBreakTorque() */
 		virtual float getBreakTorque() const = 0;
 		virtual float getBreakTorque() const = 0;
 
 
 		/** 
 		/** 
-		 * Sets the maximum torque the joint can apply before breaking. Broken joints no longer participate in physics 
+		 * Determines the maximum torque the joint can apply before breaking. Broken joints no longer participate in physics 
 		 * simulation. 
 		 * simulation. 
 		 */
 		 */
 		virtual void setBreakTorque(float torque) = 0;
 		virtual void setBreakTorque(float torque) = 0;
 
 
-		/** Checks whether collisions between the two bodies managed by the joint are enabled. */
+		/** @copydoc setEnableCollision() */
 		virtual bool getEnableCollision() const = 0;
 		virtual bool getEnableCollision() const = 0;
 
 
-		/** Sets whether collision between the two bodies managed by the joint are enabled. */
+		/** Determines whether collision between the two bodies managed by the joint are enabled. */
 		virtual void setEnableCollision(bool value) = 0;
 		virtual void setEnableCollision(bool value) = 0;
 	};
 	};
 
 

+ 43 - 54
Source/BansheeCore/Physics/BsHingeJoint.h

@@ -13,45 +13,44 @@ namespace bs
 
 
 	struct HINGE_JOINT_DESC;
 	struct HINGE_JOINT_DESC;
 
 
-	/**
-	 * Hinge joint removes all but a single rotation degree of freedom from its two attached bodies (for example a door 
-	 * hinge). 
-	 */
-	class BS_CORE_EXPORT HingeJoint : public Joint
+	/** Flags that control hinge joint options. */
+	enum class BS_SCRIPT_EXPORT(m:Physics) HingeJointFlag
 	{
 	{
-	public:
-		/** Flags that control hinge joint options. */
-		enum class Flag
-		{
-			Limit = 0x1, /**< Joint limit is enabled. */
-			Drive = 0x2 /**< Joint drive is enabled. */
-		};
+		Limit = 0x1, /**< Joint limit is enabled. */
+		Drive = 0x2 /**< Joint drive is enabled. */
+	};
 
 
-		/** Properties of a drive that drives the joint's angular velocity towards a paricular value. */
-		struct Drive
-		{
-			/** Target speed of the joint. */
-			float speed = 0.0f;
+	/** Properties of a drive that drives the joint's angular velocity towards a paricular value. */
+	struct BS_SCRIPT_EXPORT(m:Physics,pl:true) HingeJointDrive
+	{
+		/** Target speed of the joint. */
+		float speed = 0.0f;
 
 
-			/** Maximum torque the drive is allowed to apply .*/
-			float forceLimit = FLT_MAX;
+		/** Maximum torque the drive is allowed to apply .*/
+		float forceLimit = FLT_MAX;
 
 
-			/** Scales the velocity of the first body, and its response to drive torque is scaled down. */
-			float gearRatio = 1.0f;
+		/** Scales the velocity of the first body, and its response to drive torque is scaled down. */
+		float gearRatio = 1.0f;
 
 
-			/** 
-			 * If the joint is moving faster than the drive's target speed, the drive will try to break. If you don't want
-			 * the breaking to happen set this to true.
-			 */
-			bool freeSpin = false;
+		/** 
+		 * If the joint is moving faster than the drive's target speed, the drive will try to break. If you don't want
+		 * the breaking to happen set this to true.
+		 */
+		bool freeSpin = false;
 
 
-			bool operator==(const Drive& other) const
-			{
-				return speed == other.speed && forceLimit == other.forceLimit && gearRatio == other.gearRatio && 
-					freeSpin && other.freeSpin;
-			}
-		};
+		bool operator==(const HingeJointDrive& other) const
+		{
+			return speed == other.speed && forceLimit == other.forceLimit && gearRatio == other.gearRatio && 
+				freeSpin && other.freeSpin;
+		}
+	};
 
 
+	/**
+	 * Hinge joint removes all but a single rotation degree of freedom from its two attached bodies (for example a door 
+	 * hinge). 
+	 */
+	class BS_CORE_EXPORT HingeJoint : public Joint
+	{
 	public:
 	public:
 		HingeJoint(const HINGE_JOINT_DESC& desc) { }
 		HingeJoint(const HINGE_JOINT_DESC& desc) { }
 		virtual ~HingeJoint() { }
 		virtual ~HingeJoint() { }
@@ -62,43 +61,33 @@ namespace bs
 		/** Returns the current angular speed of the joint. */
 		/** Returns the current angular speed of the joint. */
 		virtual float getSpeed() const = 0;
 		virtual float getSpeed() const = 0;
 
 
-		/** 
-		 * Returns the limit of the joint. Limit constrains the motion to the specified angle range. You must enable the
-		 * limit flag on the joint in order for this to be recognized. 
-		 *
-		 * @see LimitAngularRange
-		 */
+		/** @copydoc setLimit() */
 		virtual LimitAngularRange getLimit() const = 0;
 		virtual LimitAngularRange getLimit() const = 0;
 
 
 		/**
 		/**
-		 * Sets the limit of the joint. Limit constrains the motion to the specified angle range. You must enable the limit
-		 * flag on the joint in order for this to be recognized. 
+		 * Determines the limit of the joint. Limit constrains the motion to the specified angle range. You must enable the
+		 * limit flag on the joint in order for this to be recognized. 
 		 *
 		 *
 		 * @see LimitAngularRange
 		 * @see LimitAngularRange
 		 */
 		 */
 		virtual void setLimit(const LimitAngularRange& limit) = 0;
 		virtual void setLimit(const LimitAngularRange& limit) = 0;
 
 
-		/** 
-		 * Returns the drive properties of the joint. It drives the joint's angular velocity towards a particular value. You
-		 * must enable the drive flag on the joint in order for the drive to be active.
-		 *
-		 * @see HingeJoint::Drive
-		 */
-		virtual Drive getDrive() const = 0;
+		/** @copydoc setDrive() */
+		virtual HingeJointDrive getDrive() const = 0;
 
 
 		/** 
 		/** 
-		 * Sets the drive properties of the joint. It drives the joint's angular velocity towards a particular value. You 
-		 * must enable the drive flag on the joint in order for the drive to be active.
+		 * Determines the drive properties of the joint. It drives the joint's angular velocity towards a particular value. 
+		 * You must enable the drive flag on the joint in order for the drive to be active.
 		 *
 		 *
 		 * @see HingeJoint::Drive
 		 * @see HingeJoint::Drive
 		 */
 		 */
-		virtual void setDrive(const Drive& drive) = 0;
+		virtual void setDrive(const HingeJointDrive& drive) = 0;
 
 
 		/** Enables or disables a flag that controls joint behaviour. */
 		/** Enables or disables a flag that controls joint behaviour. */
-		virtual void setFlag(Flag flag, bool enabled) = 0;
+		virtual void setFlag(HingeJointFlag flag, bool enabled) = 0;
 
 
 		/** Checks is the specified option enabled. */
 		/** Checks is the specified option enabled. */
-		virtual bool hasFlag(Flag flag) const = 0;
+		virtual bool hasFlag(HingeJointFlag flag) const = 0;
 
 
 		/** Creates a new hinge joint. */
 		/** Creates a new hinge joint. */
 		static SPtr<HingeJoint> create(const HINGE_JOINT_DESC& desc);
 		static SPtr<HingeJoint> create(const HINGE_JOINT_DESC& desc);
@@ -107,9 +96,9 @@ namespace bs
 	/** Structure used for initializing a new HingeJoint. */
 	/** Structure used for initializing a new HingeJoint. */
 	struct HINGE_JOINT_DESC : JOINT_DESC
 	struct HINGE_JOINT_DESC : JOINT_DESC
 	{
 	{
-		HingeJoint::Drive drive;
+		HingeJointDrive drive;
 		LimitAngularRange limit;
 		LimitAngularRange limit;
-		HingeJoint::Flag flag = (HingeJoint::Flag)0;
+		HingeJointFlag flag = (HingeJointFlag)0;
 	};
 	};
 
 
 	/** @} */
 	/** @} */

+ 8 - 8
Source/BansheeCore/Physics/BsJoint.h

@@ -105,7 +105,7 @@ namespace bs
 	 * Controls spring parameters for a physics joint limits. If a limit is soft (body bounces back due to restition when 
 	 * Controls spring parameters for a physics joint limits. If a limit is soft (body bounces back due to restition when 
 	 * the limit is reached) the spring will pull the body back towards the limit using the specified parameters.
 	 * the limit is reached) the spring will pull the body back towards the limit using the specified parameters.
 	 */
 	 */
-	struct Spring
+	struct BS_SCRIPT_EXPORT(m:Physics,pl:true) Spring
 	{
 	{
 		/** Constructs a spring with no force. */
 		/** Constructs a spring with no force. */
 		Spring() { }
 		Spring() { }
@@ -133,7 +133,7 @@ namespace bs
 	};
 	};
 
 
 	/** Contains common values used by all Joint limit types. */
 	/** Contains common values used by all Joint limit types. */
-	struct LimitCommon
+	struct BS_SCRIPT_EXPORT(m:Physics,pl:true) LimitCommon
 	{
 	{
 		LimitCommon(float contactDist = -1.0f)
 		LimitCommon(float contactDist = -1.0f)
 			:contactDist(contactDist)
 			:contactDist(contactDist)
@@ -160,7 +160,7 @@ namespace bs
 	};
 	};
 
 
 	/** Represents a joint limit between two distance values. Lower value must be less than the upper value. */
 	/** Represents a joint limit between two distance values. Lower value must be less than the upper value. */
-	struct LimitLinearRange : LimitCommon
+	struct BS_SCRIPT_EXPORT(m:Physics,pl:true) LimitLinearRange : LimitCommon
 	{
 	{
 		/** Constructs an empty limit. */
 		/** Constructs an empty limit. */
 		LimitLinearRange()
 		LimitLinearRange()
@@ -207,7 +207,7 @@ namespace bs
 	};
 	};
 
 
 	/** Represents a joint limit between zero a single distance value. */
 	/** Represents a joint limit between zero a single distance value. */
-	struct LimitLinear : LimitCommon
+	struct BS_SCRIPT_EXPORT(m:Physics,pl:true) LimitLinear : LimitCommon
 	{
 	{
 		/** Constructs an empty limit. */
 		/** Constructs an empty limit. */
 		LimitLinear()
 		LimitLinear()
@@ -249,7 +249,7 @@ namespace bs
 	};
 	};
 
 
 	/** Represents a joint limit between two angles. */
 	/** Represents a joint limit between two angles. */
-	struct LimitAngularRange : LimitCommon
+	struct BS_SCRIPT_EXPORT(m:Physics,pl:true) LimitAngularRange : LimitCommon
 	{
 	{
 		/** Constructs an empty limit. */
 		/** Constructs an empty limit. */
 		LimitAngularRange()
 		LimitAngularRange()
@@ -296,7 +296,7 @@ namespace bs
 	};
 	};
 
 
 	/** Represents a joint limit that contraints movement to within an elliptical cone. */
 	/** Represents a joint limit that contraints movement to within an elliptical cone. */
-	struct LimitConeRange : LimitCommon
+	struct BS_SCRIPT_EXPORT(m:Physics,pl:true) LimitConeRange : LimitCommon
 	{
 	{
 		/** Constructs a limit with a 45 degree cone. */
 		/** Constructs a limit with a 45 degree cone. */
 		LimitConeRange()
 		LimitConeRange()
@@ -337,10 +337,10 @@ namespace bs
 		}
 		}
 
 
 		/** Y angle of the cone. Movement is constrainted between 0 and this angle on the Y axis. */
 		/** Y angle of the cone. Movement is constrainted between 0 and this angle on the Y axis. */
-		Radian yLimitAngle = Radian(Math::PI * 0.5f);
+		Radian yLimitAngle = Radian(Math::HALF_PI);
 
 
 		/** Z angle of the cone. Movement is constrainted between 0 and this angle on the Z axis. */
 		/** Z angle of the cone. Movement is constrainted between 0 and this angle on the Z axis. */
-		Radian zLimitAngle = Radian(Math::PI * 0.5f);
+		Radian zLimitAngle = Radian(Math::HALF_PI);
 	};
 	};
 
 
 	/** @} */
 	/** @} */

+ 37 - 3
Source/BansheeCore/Physics/BsPhysics.h

@@ -54,7 +54,7 @@ namespace bs
 	BS_FLAGS_OPERATORS(PhysicsFlag)
 	BS_FLAGS_OPERATORS(PhysicsFlag)
 
 
 	/** Provides global physics settings, factory methods for physics objects and scene queries. */
 	/** Provides global physics settings, factory methods for physics objects and scene queries. */
-	class BS_CORE_EXPORT Physics : public Module<Physics>
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics) Physics : public Module<Physics>
 	{
 	{
 	public:
 	public:
 		Physics(const PHYSICS_INIT_DESC& init);
 		Physics(const PHYSICS_INIT_DESC& init);
@@ -74,6 +74,7 @@ namespace bs
 		 *						detected.
 		 *						detected.
 		 * @return				True if something was hit, false otherwise.
 		 * @return				True if something was hit, false otherwise.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:RayCast)
 		virtual bool rayCast(const Ray& ray, PhysicsQueryHit& hit, UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const;
 		virtual bool rayCast(const Ray& ray, PhysicsQueryHit& hit, UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const;
 
 
 		/**
 		/**
@@ -87,6 +88,7 @@ namespace bs
 		 *							detected.
 		 *							detected.
 		 * @return					True if something was hit, false otherwise.
 		 * @return					True if something was hit, false otherwise.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:RayCast)
 		virtual bool rayCast(const Vector3& origin, const Vector3& unitDir, PhysicsQueryHit& hit,
 		virtual bool rayCast(const Vector3& origin, const Vector3& unitDir, PhysicsQueryHit& hit,
 			UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 			UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 
 
@@ -102,6 +104,7 @@ namespace bs
 		 *							detected.
 		 *							detected.
 		 * @return					True if something was hit, false otherwise.
 		 * @return					True if something was hit, false otherwise.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:BoxCast)
 		virtual bool boxCast(const AABox& box, const Quaternion& rotation, const Vector3& unitDir, PhysicsQueryHit& hit,
 		virtual bool boxCast(const AABox& box, const Quaternion& rotation, const Vector3& unitDir, PhysicsQueryHit& hit,
 			UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 			UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 
 
@@ -116,6 +119,7 @@ namespace bs
 		 *							detected.
 		 *							detected.
 		 * @return					True if something was hit, false otherwise.
 		 * @return					True if something was hit, false otherwise.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:SphereCast)
 		virtual bool sphereCast(const Sphere& sphere, const Vector3& unitDir, PhysicsQueryHit& hit,
 		virtual bool sphereCast(const Sphere& sphere, const Vector3& unitDir, PhysicsQueryHit& hit,
 			UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 			UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 
 
@@ -131,6 +135,7 @@ namespace bs
 		 *							detected.
 		 *							detected.
 		 * @return					True if something was hit, false otherwise.
 		 * @return					True if something was hit, false otherwise.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:CapsuleCast)
 		virtual bool capsuleCast(const Capsule& capsule, const Quaternion& rotation, const Vector3& unitDir,
 		virtual bool capsuleCast(const Capsule& capsule, const Quaternion& rotation, const Vector3& unitDir,
 			PhysicsQueryHit& hit, UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 			PhysicsQueryHit& hit, UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 
 
@@ -147,6 +152,7 @@ namespace bs
 		 *							detected.
 		 *							detected.
 		 * @return					True if something was hit, false otherwise.
 		 * @return					True if something was hit, false otherwise.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:ConvexCast)
 		virtual bool convexCast(const HPhysicsMesh& mesh, const Vector3& position, const Quaternion& rotation,
 		virtual bool convexCast(const HPhysicsMesh& mesh, const Vector3& position, const Quaternion& rotation,
 			const Vector3& unitDir, PhysicsQueryHit& hit, UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 			const Vector3& unitDir, PhysicsQueryHit& hit, UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 
 
@@ -159,6 +165,7 @@ namespace bs
 		 *						detected.
 		 *						detected.
 		 * @return				List of all detected hits.
 		 * @return				List of all detected hits.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:RayCastAll)
 		virtual Vector<PhysicsQueryHit> rayCastAll(const Ray& ray, UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const;
 		virtual Vector<PhysicsQueryHit> rayCastAll(const Ray& ray, UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const;
 
 
 		/**
 		/**
@@ -171,6 +178,7 @@ namespace bs
 		 *							detected.
 		 *							detected.
 		 * @return					List of all detected hits.
 		 * @return					List of all detected hits.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:RayCastAll)
 		virtual Vector<PhysicsQueryHit> rayCastAll(const Vector3& origin, const Vector3& unitDir,
 		virtual Vector<PhysicsQueryHit> rayCastAll(const Vector3& origin, const Vector3& unitDir,
 			UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 			UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 
 
@@ -185,6 +193,7 @@ namespace bs
 		 *							detected.
 		 *							detected.
 		 * @return					List of all detected hits.
 		 * @return					List of all detected hits.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:BoxCastAll)
 		virtual Vector<PhysicsQueryHit> boxCastAll(const AABox& box, const Quaternion& rotation, 
 		virtual Vector<PhysicsQueryHit> boxCastAll(const AABox& box, const Quaternion& rotation, 
 			const Vector3& unitDir, UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 			const Vector3& unitDir, UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 
 
@@ -198,6 +207,7 @@ namespace bs
 		 *							detected.
 		 *							detected.
 		 * @return					List of all detected hits.
 		 * @return					List of all detected hits.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:SphereCastAll)
 		virtual Vector<PhysicsQueryHit> sphereCastAll(const Sphere& sphere, const Vector3& unitDir,
 		virtual Vector<PhysicsQueryHit> sphereCastAll(const Sphere& sphere, const Vector3& unitDir,
 			UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 			UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 
 
@@ -212,6 +222,7 @@ namespace bs
 		 *							detected.
 		 *							detected.
 		 * @return					List of all detected hits.
 		 * @return					List of all detected hits.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:CapsuleCastAll)
 		virtual Vector<PhysicsQueryHit> capsuleCastAll(const Capsule& capsule, const Quaternion& rotation, 
 		virtual Vector<PhysicsQueryHit> capsuleCastAll(const Capsule& capsule, const Quaternion& rotation, 
 			const Vector3& unitDir, UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 			const Vector3& unitDir, UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 
 
@@ -227,6 +238,7 @@ namespace bs
 		 *							detected.
 		 *							detected.
 		 * @return					List of all detected hits.
 		 * @return					List of all detected hits.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:ConvexCastAll)
 		virtual Vector<PhysicsQueryHit> convexCastAll(const HPhysicsMesh& mesh, const Vector3& position, 
 		virtual Vector<PhysicsQueryHit> convexCastAll(const HPhysicsMesh& mesh, const Vector3& position, 
 			const Quaternion& rotation, const Vector3& unitDir, UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 			const Quaternion& rotation, const Vector3& unitDir, UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 
 
@@ -240,6 +252,7 @@ namespace bs
 		 *						detected.
 		 *						detected.
 		 * @return				True if something was hit, false otherwise.
 		 * @return				True if something was hit, false otherwise.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:RayCastAny)
 		virtual bool rayCastAny(const Ray& ray, UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const;
 		virtual bool rayCastAny(const Ray& ray, UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const;
 
 
 		/**
 		/**
@@ -253,6 +266,7 @@ namespace bs
 		 *							detected.
 		 *							detected.
 		 * @return					True if something was hit, false otherwise.
 		 * @return					True if something was hit, false otherwise.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:RayCastAny)
 		virtual bool rayCastAny(const Vector3& origin, const Vector3& unitDir,
 		virtual bool rayCastAny(const Vector3& origin, const Vector3& unitDir,
 			UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 			UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 
 
@@ -268,6 +282,7 @@ namespace bs
 		 *							detected.
 		 *							detected.
 		 * @return					True if something was hit, false otherwise.
 		 * @return					True if something was hit, false otherwise.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:BoxCastAny)
 		virtual bool boxCastAny(const AABox& box, const Quaternion& rotation, const Vector3& unitDir,
 		virtual bool boxCastAny(const AABox& box, const Quaternion& rotation, const Vector3& unitDir,
 			UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 			UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 
 
@@ -282,6 +297,7 @@ namespace bs
 		 *							detected.
 		 *							detected.
 		 * @return					True if something was hit, false otherwise.
 		 * @return					True if something was hit, false otherwise.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:SphereCastAny)
 		virtual bool sphereCastAny(const Sphere& sphere, const Vector3& unitDir,
 		virtual bool sphereCastAny(const Sphere& sphere, const Vector3& unitDir,
 			UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 			UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 
 
@@ -297,6 +313,7 @@ namespace bs
 		 *							detected.
 		 *							detected.
 		 * @return					True if something was hit, false otherwise.
 		 * @return					True if something was hit, false otherwise.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:CapsuleCastAny)
 		virtual bool capsuleCastAny(const Capsule& capsule, const Quaternion& rotation, const Vector3& unitDir,
 		virtual bool capsuleCastAny(const Capsule& capsule, const Quaternion& rotation, const Vector3& unitDir,
 			UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 			UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 
 
@@ -313,6 +330,7 @@ namespace bs
 		 *							detected.
 		 *							detected.
 		 * @return					True if something was hit, false otherwise.
 		 * @return					True if something was hit, false otherwise.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:ConvexCastAny)
 		virtual bool convexCastAny(const HPhysicsMesh& mesh, const Vector3& position, const Quaternion& rotation,
 		virtual bool convexCastAny(const HPhysicsMesh& mesh, const Vector3& position, const Quaternion& rotation,
 			const Vector3& unitDir, UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 			const Vector3& unitDir, UINT64 layer = BS_ALL_LAYERS, float max = FLT_MAX) const = 0;
 
 
@@ -324,6 +342,7 @@ namespace bs
 		 * @param[in]	layer		Layers to consider for the query. This allows you to ignore certain groups of objects.
 		 * @param[in]	layer		Layers to consider for the query. This allows you to ignore certain groups of objects.
 		 * @return					List of all colliders that overlap the box.
 		 * @return					List of all colliders that overlap the box.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:BoxOverlap)
 		virtual Vector<HCollider> boxOverlap(const AABox& box, const Quaternion& rotation, 
 		virtual Vector<HCollider> boxOverlap(const AABox& box, const Quaternion& rotation, 
 			UINT64 layer = BS_ALL_LAYERS) const;
 			UINT64 layer = BS_ALL_LAYERS) const;
 
 
@@ -334,6 +353,7 @@ namespace bs
 		 * @param[in]	layer		Layers to consider for the query. This allows you to ignore certain groups of objects.
 		 * @param[in]	layer		Layers to consider for the query. This allows you to ignore certain groups of objects.
 		 * @return					List of all colliders that overlap the sphere.
 		 * @return					List of all colliders that overlap the sphere.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:SphereOverlap)
 		virtual Vector<HCollider> sphereOverlap(const Sphere& sphere, UINT64 layer = BS_ALL_LAYERS) const;
 		virtual Vector<HCollider> sphereOverlap(const Sphere& sphere, UINT64 layer = BS_ALL_LAYERS) const;
 
 
 		/**
 		/**
@@ -344,6 +364,7 @@ namespace bs
 		 * @param[in]	layer		Layers to consider for the query. This allows you to ignore certain groups of objects.
 		 * @param[in]	layer		Layers to consider for the query. This allows you to ignore certain groups of objects.
 		 * @return					List of all colliders that overlap the capsule.
 		 * @return					List of all colliders that overlap the capsule.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:CapsuleOverlap)
 		virtual Vector<HCollider> capsuleOverlap(const Capsule& capsule, const Quaternion& rotation,
 		virtual Vector<HCollider> capsuleOverlap(const Capsule& capsule, const Quaternion& rotation,
 			UINT64 layer = BS_ALL_LAYERS) const;
 			UINT64 layer = BS_ALL_LAYERS) const;
 
 
@@ -356,6 +377,7 @@ namespace bs
 		 * @param[in]	layer		Layers to consider for the query. This allows you to ignore certain groups of objects.
 		 * @param[in]	layer		Layers to consider for the query. This allows you to ignore certain groups of objects.
 		 * @return					List of all colliders that overlap the mesh.
 		 * @return					List of all colliders that overlap the mesh.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:ConvexOverlap)
 		virtual Vector<HCollider> convexOverlap(const HPhysicsMesh& mesh, const Vector3& position, 
 		virtual Vector<HCollider> convexOverlap(const HPhysicsMesh& mesh, const Vector3& position, 
 			const Quaternion& rotation, UINT64 layer = BS_ALL_LAYERS) const;
 			const Quaternion& rotation, UINT64 layer = BS_ALL_LAYERS) const;
 
 
@@ -367,6 +389,7 @@ namespace bs
 		 * @param[in]	layer		Layers to consider for the query. This allows you to ignore certain groups of objects.
 		 * @param[in]	layer		Layers to consider for the query. This allows you to ignore certain groups of objects.
 		 * @return					True if there is overlap with another object, false otherwise.
 		 * @return					True if there is overlap with another object, false otherwise.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:BoxOverlapAny)
 		virtual bool boxOverlapAny(const AABox& box, const Quaternion& rotation, UINT64 layer = BS_ALL_LAYERS) const = 0;
 		virtual bool boxOverlapAny(const AABox& box, const Quaternion& rotation, UINT64 layer = BS_ALL_LAYERS) const = 0;
 
 
 		/**
 		/**
@@ -376,6 +399,7 @@ namespace bs
 		 * @param[in]	layer		Layers to consider for the query. This allows you to ignore certain groups of objects.
 		 * @param[in]	layer		Layers to consider for the query. This allows you to ignore certain groups of objects.
 		 * @return					True if there is overlap with another object, false otherwise.
 		 * @return					True if there is overlap with another object, false otherwise.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:SphereOverlapAny)
 		virtual bool sphereOverlapAny(const Sphere& sphere, UINT64 layer = BS_ALL_LAYERS) const = 0;
 		virtual bool sphereOverlapAny(const Sphere& sphere, UINT64 layer = BS_ALL_LAYERS) const = 0;
 
 
 		/**
 		/**
@@ -386,6 +410,7 @@ namespace bs
 		 * @param[in]	layer		Layers to consider for the query. This allows you to ignore certain groups of objects.
 		 * @param[in]	layer		Layers to consider for the query. This allows you to ignore certain groups of objects.
 		 * @return					True if there is overlap with another object, false otherwise.
 		 * @return					True if there is overlap with another object, false otherwise.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:CapsuleOverlapAny)
 		virtual bool capsuleOverlapAny(const Capsule& capsule, const Quaternion& rotation, 
 		virtual bool capsuleOverlapAny(const Capsule& capsule, const Quaternion& rotation, 
 			UINT64 layer = BS_ALL_LAYERS) const = 0;
 			UINT64 layer = BS_ALL_LAYERS) const = 0;
 
 
@@ -398,6 +423,7 @@ namespace bs
 		 * @param[in]	layer		Layers to consider for the query. This allows you to ignore certain groups of objects.
 		 * @param[in]	layer		Layers to consider for the query. This allows you to ignore certain groups of objects.
 		 * @return					True if there is overlap with another object, false otherwise.
 		 * @return					True if there is overlap with another object, false otherwise.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:ConvexOverlapAny)
 		virtual bool convexOverlapAny(const HPhysicsMesh& mesh, const Vector3& position, const Quaternion& rotation,
 		virtual bool convexOverlapAny(const HPhysicsMesh& mesh, const Vector3& position, const Quaternion& rotation,
 			UINT64 layer = BS_ALL_LAYERS) const = 0;
 			UINT64 layer = BS_ALL_LAYERS) const = 0;
 
 
@@ -414,10 +440,12 @@ namespace bs
 		/** Pauses or resumes the physics simulation. */
 		/** Pauses or resumes the physics simulation. */
 		virtual void setPaused(bool paused) = 0;
 		virtual void setPaused(bool paused) = 0;
 
 
-		/** Gets the global gravity value for all objects in the scene. */
+		/** @copydoc setGravity() */
+		BS_SCRIPT_EXPORT(n:Gravity,pr:getter)
 		virtual Vector3 getGravity() const = 0;
 		virtual Vector3 getGravity() const = 0;
 
 
-		/** Sets the global gravity value for all objects in the scene. */
+		/** Determines the global gravity value for all objects in the scene. */
+		BS_SCRIPT_EXPORT(n:Gravity,pr:setter)
 		virtual void setGravity(const Vector3& gravity) = 0;
 		virtual void setGravity(const Vector3& gravity) = 0;
 
 
 		/** 
 		/** 
@@ -425,12 +453,15 @@ namespace bs
 		 * allowed to be in, and objects outside of these regions will not be handled by physics. You do not need to set
 		 * allowed to be in, and objects outside of these regions will not be handled by physics. You do not need to set
 		 * up these regions by default.
 		 * up these regions by default.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:AddPhysicsRegion)
 		virtual UINT32 addBroadPhaseRegion(const AABox& region) = 0;
 		virtual UINT32 addBroadPhaseRegion(const AABox& region) = 0;
 
 
 		/** Removes a physics region. */
 		/** Removes a physics region. */
+		BS_SCRIPT_EXPORT(n:RemovePhysicsRegion)
 		virtual void removeBroadPhaseRegion(UINT32 handle) = 0;
 		virtual void removeBroadPhaseRegion(UINT32 handle) = 0;
 
 
 		/** Removes all physics regions. */
 		/** Removes all physics regions. */
+		BS_SCRIPT_EXPORT(n:ClearPhysicsRegions)
 		virtual void clearBroadPhaseRegions() = 0;
 		virtual void clearBroadPhaseRegions() = 0;
 
 
 		/** 
 		/** 
@@ -451,9 +482,11 @@ namespace bs
 		 * Enables or disables collision between two layers. Each physics object can be assigned a specific layer, and here
 		 * Enables or disables collision between two layers. Each physics object can be assigned a specific layer, and here
 		 * you can determine which layers can interact with each other.
 		 * you can determine which layers can interact with each other.
 		 */
 		 */
+		BS_SCRIPT_EXPORT(n:ToggleCollision)
 		void toggleCollision(UINT64 groupA, UINT64 groupB, bool enabled);
 		void toggleCollision(UINT64 groupA, UINT64 groupB, bool enabled);
 
 
 		/** Checks if two collision layers are allowed to interact. */
 		/** Checks if two collision layers are allowed to interact. */
+		BS_SCRIPT_EXPORT(n:IsCollisionEnabled)
 		bool isCollisionEnabled(UINT64 groupA, UINT64 groupB) const;
 		bool isCollisionEnabled(UINT64 groupA, UINT64 groupB) const;
 
 
 		/** @name Internal
 		/** @name Internal
@@ -544,6 +577,7 @@ namespace bs
 			float maxDist = FLT_MAX) const = 0;
 			float maxDist = FLT_MAX) const = 0;
 
 
 		/** Checks is the physics simulation update currently in progress. */
 		/** Checks is the physics simulation update currently in progress. */
+		BS_SCRIPT_EXPORT(n:IsUpdateInProgress,pr:getter)
 		bool _isUpdateInProgress() const { return mUpdateInProgress; }
 		bool _isUpdateInProgress() const { return mUpdateInProgress; }
 
 
 		/** @} */
 		/** @} */

+ 18 - 10
Source/BansheeCore/Physics/BsPhysicsCommon.h

@@ -13,7 +13,7 @@ namespace bs
 	 */
 	 */
 
 
 	/** Information about a single contact point during physics collision. */
 	/** Information about a single contact point during physics collision. */
-	struct ContactPoint
+	struct BS_SCRIPT_EXPORT(m:Physics,pl:true) ContactPoint
 	{
 	{
 		Vector3 position; /**< Contact point in world space. */
 		Vector3 position; /**< Contact point in world space. */
 		Vector3 normal; /**< Normal pointing from the second shape to the first shape. */
 		Vector3 normal; /**< Normal pointing from the second shape to the first shape. */
@@ -23,15 +23,20 @@ namespace bs
 	};
 	};
 
 
 	/** Information about a collision between two physics objects. */
 	/** Information about a collision between two physics objects. */
-	struct CollisionData
+	struct CollisionDataRaw
 	{
 	{
-		Collider* collidersRaw[2]; /**< Colliders involved in the collision. */
+		Collider* colliders[2]; /**< Colliders involved in the collision. */
 
 
-		/** 
-		 * Components of the colliders that were hit. Can be null if collider is not owned by a component, in which case
-		 * use #collidersRaw directly. 
-		 */
+		// Note: Not too happy this is heap allocated, use static allocator?
+		Vector<ContactPoint> contactPoints; /**< Information about all the contact points for the hit. */ 
+	};
+
+	/** Information about a collision between two physics objects. */
+	struct BS_SCRIPT_EXPORT(m:Physics,pl:true) CollisionData
+	{
+		/** Components of the colliders that have collided. */
 		HCollider collider[2]; 
 		HCollider collider[2]; 
+
 		// Note: Not too happy this is heap allocated, use static allocator?
 		// Note: Not too happy this is heap allocated, use static allocator?
 		Vector<ContactPoint> contactPoints; /**< Information about all the contact points for the hit. */ 
 		Vector<ContactPoint> contactPoints; /**< Information about all the contact points for the hit. */ 
 	};
 	};
@@ -52,7 +57,7 @@ namespace bs
 	};
 	};
 
 
 	/** Determines which collision events will be reported by physics objects. */
 	/** Determines which collision events will be reported by physics objects. */
-	enum class CollisionReportMode
+	enum class BS_SCRIPT_EXPORT(m:Physics) CollisionReportMode
 	{
 	{
 		None, /**< No collision events will be triggered. */
 		None, /**< No collision events will be triggered. */
 		Report, /**< Collision events will be triggered when object enters and/or leaves collision. */
 		Report, /**< Collision events will be triggered when object enters and/or leaves collision. */
@@ -64,19 +69,22 @@ namespace bs
 	};
 	};
 
 
 	/** Hit information from a physics query. */
 	/** Hit information from a physics query. */
-	struct PhysicsQueryHit
+	struct BS_SCRIPT_EXPORT(m:Physics,pl:true) PhysicsQueryHit
 	{
 	{
 		Vector3 point; /**< Position of the hit in world space. */
 		Vector3 point; /**< Position of the hit in world space. */
 		Vector3 normal; /**< Normal to the surface that was hit. */
 		Vector3 normal; /**< Normal to the surface that was hit. */
 		Vector2 uv; /**< Barycentric coordinates of the triangle that was hit (only applicable when triangle meshes are hit). */
 		Vector2 uv; /**< Barycentric coordinates of the triangle that was hit (only applicable when triangle meshes are hit). */
 		float distance = 0.0f; /**< Distance from the query origin to the hit position. */
 		float distance = 0.0f; /**< Distance from the query origin to the hit position. */
 		UINT32 triangleIdx = 0; /**< Index of the triangle that was hit (only applicable when triangle meshes are hit). */
 		UINT32 triangleIdx = 0; /**< Index of the triangle that was hit (only applicable when triangle meshes are hit). */
-		Collider* colliderRaw = nullptr; /**< Collider that was hit. */
+
 		/** 
 		/** 
 		 * Component of the collider that was hit. This may be null if the hit collider has no owner component, in which
 		 * Component of the collider that was hit. This may be null if the hit collider has no owner component, in which
 		 * case refer to #colliderRaw.
 		 * case refer to #colliderRaw.
 		 */
 		 */
 		HCollider collider;
 		HCollider collider;
+
+		BS_SCRIPT_EXPORT(ex:true)
+		Collider* colliderRaw = nullptr; /**< Collider that was hit. */
 	};
 	};
 
 
 	/** @} */
 	/** @} */

+ 56 - 60
Source/BansheeCore/Physics/BsRigidbody.h

@@ -12,7 +12,7 @@ namespace bs
 	 */
 	 */
 
 
 	/** Type of force or torque that can be applied to a rigidbody. */
 	/** Type of force or torque that can be applied to a rigidbody. */
-	enum class ForceMode
+	enum class BS_SCRIPT_EXPORT(m:Physics) ForceMode
 	{
 	{
 		Force, /**< Value applied is a force. */
 		Force, /**< Value applied is a force. */
 		Impulse, /**< Value applied is an impulse (a direct change in its linear or angular momentum). */
 		Impulse, /**< Value applied is an impulse (a direct change in its linear or angular momentum). */
@@ -21,12 +21,28 @@ namespace bs
 	};
 	};
 
 
 	/** Type of force that can be applied to a rigidbody at an arbitrary point. */
 	/** Type of force that can be applied to a rigidbody at an arbitrary point. */
-	enum class PointForceMode
+	enum class BS_SCRIPT_EXPORT(m:Physics) PointForceMode
 	{
 	{
 		Force, /**< Value applied is a force. */
 		Force, /**< Value applied is a force. */
 		Impulse, /**< Value applied is an impulse (a direct change in its linear or angular momentum). */
 		Impulse, /**< Value applied is an impulse (a direct change in its linear or angular momentum). */
 	};
 	};
 
 
+	/** Flags that control options of a Rigidbody object. */
+	enum class BS_SCRIPT_EXPORT(m:Physics) RigidbodyFlag
+	{
+		/** No options. */
+		None = 0x00,
+		/** Automatically calculate center of mass transform and inertia tensors from child shapes (colliders). */
+		AutoTensors = 0x01,
+		/** Calculate mass distribution from child shapes (colliders). Only relevant when auto-tensors is on. */
+		AutoMass = 0x02,
+		/** 
+		 * Enables continous collision detection. This can prevent fast moving bodies from tunneling through each other.
+		 * This must also be enabled globally in Physics otherwise the flag will be ignored.
+		 */
+		CCD = 0x04
+	};
+
 	/**
 	/**
 	 * Rigidbody is a dynamic physics object that can be moved using forces (or directly). It will interact with other
 	 * Rigidbody is a dynamic physics object that can be moved using forces (or directly). It will interact with other
 	 * static and dynamic physics objects in the scene accordingly (it will push other non-kinematic rigidbodies, 
 	 * static and dynamic physics objects in the scene accordingly (it will push other non-kinematic rigidbodies, 
@@ -38,22 +54,6 @@ namespace bs
 	class BS_CORE_EXPORT Rigidbody
 	class BS_CORE_EXPORT Rigidbody
 	{
 	{
 	public:
 	public:
-		/** Flags that control options of a Rigidbody object. */
-		enum class Flag
-		{
-			/** No options. */
-			None = 0x00,
-			/** Automatically calculate center of mass transform and inertia tensors from child shapes (colliders). */
-			AutoTensors = 0x01,
-			/** Calculate mass distribution from child shapes (colliders). Only relevant when auto-tensors is on. */
-			AutoMass = 0x02,
-			/** 
-			 * Enables continous collision detection. This can prevent fast moving bodies from tunneling through each other.
-			 * This must also be enabled globally in Physics otherwise the flag will be ignored.
-			 */
-			CCD = 0x04
-		};
-
 		/** 
 		/** 
 		 * Constructs a new rigidbody. 
 		 * Constructs a new rigidbody. 
 		 *
 		 *
@@ -90,25 +90,22 @@ namespace bs
 		virtual void setTransform(const Vector3& pos, const Quaternion& rot) = 0;
 		virtual void setTransform(const Vector3& pos, const Quaternion& rot) = 0;
 
 
 		/** 
 		/** 
-		 * Sets the mass of the object and all of its collider shapes. Only relevant if Flag::AutoMass or Flag::AutoTensors
-		 * is turned off. Value of zero means the object is immovable (but can be rotated).
+		 * Determines the mass of the object and all of its collider shapes. Only relevant if RigidbodyFlag::AutoMass or 
+		 * RigidbodyFlag::AutoTensors is turned off. Value of zero means the object is immovable (but can be rotated).
 		 */
 		 */
 		virtual void setMass(float mass) = 0;
 		virtual void setMass(float mass) = 0;
 
 
-		/** 
-		 * Returns the mass of the object. This may be mass manually set by setMass(), or the mass of all child colliders,
-		 * depending if the mass is calculated automatically or not.
-		 */
+		/** @copydoc setMass() */
 		virtual float getMass() const = 0;
 		virtual float getMass() const = 0;
 
 
 		/** 
 		/** 
-		 * Sets if the body is kinematic. Kinematic body will not move in response to external forces (for example gravity,
-		 * or another object pushing it), essentially behaving like collider. Unlike a collider though, you can still move
-		 * the object and have other dynamic objects respond correctly (meaning it will push other objects).
+		 * Determines if the body is kinematic. Kinematic body will not move in response to external forces (for example
+		 * gravity, or another object pushing it), essentially behaving like collider. Unlike a collider though, you can
+		 * still move the object and have other dynamic objects respond correctly (meaning it will push other objects).
 		 */
 		 */
 		virtual void setIsKinematic(bool kinematic) = 0;
 		virtual void setIsKinematic(bool kinematic) = 0;
 
 
-		/** Checks if the body is kinematic. */
+		/** @copydoc setIsKinematic() */
 		virtual bool getIsKinematic() const = 0;
 		virtual bool getIsKinematic() const = 0;
 
 
 		/** 
 		/** 
@@ -127,60 +124,60 @@ namespace bs
 		 */
 		 */
 		virtual void wakeUp() = 0;
 		virtual void wakeUp() = 0;
 
 
-		/** Sets a threshold of force and torque under which the object will be considered to be put to sleep. */
+		/** Determines a threshold of force and torque under which the object will be considered to be put to sleep. */
 		virtual void setSleepThreshold(float threshold) = 0;
 		virtual void setSleepThreshold(float threshold) = 0;
 
 
-		/** Gets a threshold of force and torque under which the object will be considered to be put to sleep. */
+		/** @copydoc setSleepThreshold() */
 		virtual float getSleepThreshold() const = 0;
 		virtual float getSleepThreshold() const = 0;
 
 
-		/** Sets whether or not the rigidbody will have the global gravity force applied to it. */
+		/** Determines whether or not the rigidbody will have the global gravity force applied to it. */
 		virtual void setUseGravity(bool gravity) = 0;
 		virtual void setUseGravity(bool gravity) = 0;
 
 
-		/** Gets whether or not the rigidbody will have the global gravity force applied to it. */
+		/** @copydoc setUseGravity() */
 		virtual bool getUseGravity() const = 0;
 		virtual bool getUseGravity() const = 0;
 
 
-		/** Sets the linear velocity of the body. */
+		/** Determines the linear velocity of the body. */
 		virtual void setVelocity(const Vector3& velocity) = 0;
 		virtual void setVelocity(const Vector3& velocity) = 0;
 
 
-		/** Returns the current linear velocity of the body. */
+		/** @copydoc setVelocity() */
 		virtual Vector3 getVelocity() const = 0;
 		virtual Vector3 getVelocity() const = 0;
 
 
-		/** Sets the angular velocity of the body. */
+		/** Determines the angular velocity of the body. */
 		virtual void setAngularVelocity(const Vector3& velocity) = 0;
 		virtual void setAngularVelocity(const Vector3& velocity) = 0;
 
 
-		/** Returns the current angular velocity of the body. */
+		/** @copydoc setAngularVelocity() */
 		virtual Vector3 getAngularVelocity() const = 0;
 		virtual Vector3 getAngularVelocity() const = 0;
 
 
-		/** Sets the linear drag of the body. Higher drag values means the object resists linear movement more. */
+		/** Determines the linear drag of the body. Higher drag values means the object resists linear movement more. */
 		virtual void setDrag(float drag) = 0;
 		virtual void setDrag(float drag) = 0;
 
 
-		/** Gets the linear drag of the body. Higher drag values means the object resists linear movement more. */
+		/** @copydoc setDrag() */
 		virtual float getDrag() const = 0;
 		virtual float getDrag() const = 0;
 
 
-		/** Sets the angular drag of the body. Higher drag values means the object resists angular movement more. */
+		/** Determines the angular drag of the body. Higher drag values means the object resists angular movement more. */
 		virtual void setAngularDrag(float drag) = 0;
 		virtual void setAngularDrag(float drag) = 0;
 
 
-		/** Gets the angular drag of the body. Higher drag values means the object resists angular movement more. */
+		/** @copydoc setAngularDrag() */
 		virtual float getAngularDrag() const = 0;
 		virtual float getAngularDrag() const = 0;
 
 
 		/** 
 		/** 
-		 * Sets the inertia tensor in local mass space. Inertia tensor determines how difficult is to rotate the object.
-		 * Values of zero in the inertia tensor mean the object will be unable to rotate around a specific axis. Only 
-		 * relevant if Flag::AutoTensors is turned off.
+		 * Determines the inertia tensor in local mass space. Inertia tensor determines how difficult is to rotate the
+		 * object. Values of zero in the inertia tensor mean the object will be unable to rotate around a specific axis. 
+		 * Only relevant if RigidbodyFlag::AutoTensors is turned off.
 		 */
 		 */
 		virtual void setInertiaTensor(const Vector3& tensor) = 0;
 		virtual void setInertiaTensor(const Vector3& tensor) = 0;
 
 
-		/** Gets the inertia tensor in local mass space.  */
+		/** @copydoc setInertiaTensor() */
 		virtual Vector3 getInertiaTensor() const = 0;
 		virtual Vector3 getInertiaTensor() const = 0;
 
 
-		/** Returns the maximum angular velocity of the rigidbody. Velocity will be clamped to this value. */
+		/** Determines the maximum angular velocity of the rigidbody. Velocity will be clamped to this value. */
 		virtual void setMaxAngularVelocity(float maxVelocity) = 0;
 		virtual void setMaxAngularVelocity(float maxVelocity) = 0;
 
 
-		/** Gets the maximum angular velocity of the rigidbody. */
+		/** @copydoc setMaxAngularVelocity() */
 		virtual float getMaxAngularVelocity() const = 0;
 		virtual float getMaxAngularVelocity() const = 0;
 
 
 		/**
 		/**
-		 * Sets the rigidbody's center of mass transform. Only relevant if Flag::AutoTensors is turned off.
+		 * Sets the rigidbody's center of mass transform. Only relevant if RigibodyFlag::AutoTensors is turned off.
 		 *
 		 *
 		 * @param[in]	position	Position of the center of mass.
 		 * @param[in]	position	Position of the center of mass.
 		 * @param[in]	rotation	Rotation that determines orientation of the inertia tensor (rotation of the center of 
 		 * @param[in]	rotation	Rotation that determines orientation of the inertia tensor (rotation of the center of 
@@ -195,29 +192,28 @@ namespace bs
 		virtual Quaternion getCenterOfMassRotation() const = 0;
 		virtual Quaternion getCenterOfMassRotation() const = 0;
 
 
 		/** 
 		/** 
-		 * Sets the number of iterations to use when solving for position. Higher values can improve precision and 
+		 * Determines the number of iterations to use when solving for position. Higher values can improve precision and 
 		 * numerical stability of the simulation. 
 		 * numerical stability of the simulation. 
 		 */
 		 */
 		virtual void setPositionSolverCount(UINT32 count) = 0;
 		virtual void setPositionSolverCount(UINT32 count) = 0;
 
 
-		/** Gets the number of iterations to use when solving for position. */
+		/** @copydoc setPositionSolverCount() */
 		virtual UINT32 getPositionSolverCount() const = 0;
 		virtual UINT32 getPositionSolverCount() const = 0;
 
 
-
 		/** 
 		/** 
-		 * Sets the number of iterations to use when solving for velocity. Higher values can improve precision and 
+		 * Determines the number of iterations to use when solving for velocity. Higher values can improve precision and 
 		 * numerical stability of the simulation. 
 		 * numerical stability of the simulation. 
 		 */
 		 */
 		virtual void setVelocitySolverCount(UINT32 count) = 0;
 		virtual void setVelocitySolverCount(UINT32 count) = 0;
 
 
-		/** Gets the number of iterations to use when solving for velocity. */
+		/** @copydoc setVelocitySolverCount() */
 		virtual UINT32 getVelocitySolverCount() const = 0;
 		virtual UINT32 getVelocitySolverCount() const = 0;
 
 
-		/** Sets flags that control the behaviour of the rigidbody. */
-		virtual void setFlags(Flag flags) { mFlags = flags; }
+		/** Flags that control the behaviour of the rigidbody. */
+		virtual void setFlags(RigidbodyFlag flags) { mFlags = flags; }
 
 
-		/** Gets flags that control the behaviour of the rigidbody. */
-		virtual Flag getFlags() const { return mFlags; }
+		/** @copydoc setFlags() */
+		virtual RigidbodyFlag getFlags() const { return mFlags; }
 
 
 		/** 
 		/** 
 		 * Applies a force to the center of the mass of the rigidbody. This will produce linear momentum.
 		 * Applies a force to the center of the mass of the rigidbody. This will produce linear momentum.
@@ -282,13 +278,13 @@ namespace bs
 		static SPtr<Rigidbody> create(const HSceneObject& linkedSO);
 		static SPtr<Rigidbody> create(const HSceneObject& linkedSO);
 
 
 		/** Triggered when one of the colliders owned by the rigidbody starts colliding with another object. */
 		/** Triggered when one of the colliders owned by the rigidbody starts colliding with another object. */
-		Event<void(const CollisionData&)> onCollisionBegin;
+		Event<void(const CollisionDataRaw&)> onCollisionBegin;
 
 
 		/** Triggered when a previously colliding collider stays in collision. Triggered once per frame. */
 		/** Triggered when a previously colliding collider stays in collision. Triggered once per frame. */
-		Event<void(const CollisionData&)> onCollisionStay;
+		Event<void(const CollisionDataRaw&)> onCollisionStay;
 
 
 		/** Triggered when one of the colliders owned by the rigidbody stops colliding with another object. */
 		/** Triggered when one of the colliders owned by the rigidbody stops colliding with another object. */
-		Event<void(const CollisionData&)> onCollisionEnd;
+		Event<void(const CollisionDataRaw&)> onCollisionEnd;
 
 
 		/** @name Internal
 		/** @name Internal
 		 *  @{
 		 *  @{
@@ -326,7 +322,7 @@ namespace bs
 	protected:
 	protected:
 		friend class FCollider;
 		friend class FCollider;
 
 
-		Flag mFlags = Flag::None;
+		RigidbodyFlag mFlags = RigidbodyFlag::None;
 		PhysicsObjectOwner mOwner;
 		PhysicsObjectOwner mOwner;
 		UINT32 mPhysicsId = 0;
 		UINT32 mPhysicsId = 0;
 		HSceneObject mLinkedSO;
 		HSceneObject mLinkedSO;

+ 11 - 17
Source/BansheeCore/Physics/BsSliderJoint.h

@@ -13,18 +13,17 @@ namespace bs
 
 
 	struct SLIDER_JOINT_DESC;
 	struct SLIDER_JOINT_DESC;
 
 
+	/** Flag that controls slider joint's behaviour. */
+	enum class BS_SCRIPT_EXPORT(m:Physics) SliderJointFlag
+	{
+		Limit = 0x1 /**< Enables the linear range limit. */
+	};
+
 	/** 
 	/** 
 	 * Joint that removes all but a single translational degree of freedom. Bodies are allowed to move along a single axis. 
 	 * Joint that removes all but a single translational degree of freedom. Bodies are allowed to move along a single axis. 
 	 */
 	 */
 	class BS_CORE_EXPORT SliderJoint : public Joint
 	class BS_CORE_EXPORT SliderJoint : public Joint
 	{
 	{
-	public:
-		/** Flag that controls slider joint's behaviour. */
-		enum class Flag
-		{
-			Limit = 0x1 /**< Enables the linear range limit. */
-		};
-
 	public:
 	public:
 		SliderJoint(const SLIDER_JOINT_DESC& desc) { }
 		SliderJoint(const SLIDER_JOINT_DESC& desc) { }
 		virtual ~SliderJoint() { }
 		virtual ~SliderJoint() { }
@@ -35,16 +34,11 @@ namespace bs
 		/** Returns the current speed of the slider. */
 		/** Returns the current speed of the slider. */
 		virtual float getSpeed() const = 0;
 		virtual float getSpeed() const = 0;
 
 
-		/** 
-		 * Returns a limit that constrains the movement of the joint to a specific minimum and maximum distance. You must
-		 * enable the limit flag on the joint in order for this to be recognized. 
-		 *
-		 * @see LimitLinearRange
-		 */
+		/** @copydoc setLimit() */
 		virtual LimitLinearRange getLimit() const = 0;
 		virtual LimitLinearRange getLimit() const = 0;
 
 
 		/** 
 		/** 
-		 * Sets a limit that constrains the movement of the joint to a specific minimum and maximum distance. You must
+		 * Determines a limit that constrains the movement of the joint to a specific minimum and maximum distance. You must
 		 * enable the limit flag on the joint in order for this to be recognized. 
 		 * enable the limit flag on the joint in order for this to be recognized. 
 		 *
 		 *
 		 * @see LimitLinearRange
 		 * @see LimitLinearRange
@@ -52,10 +46,10 @@ namespace bs
 		virtual void setLimit(const LimitLinearRange& limit) = 0;
 		virtual void setLimit(const LimitLinearRange& limit) = 0;
 
 
 		/** Enables or disables a flag that controls the joint's behaviour. */
 		/** Enables or disables a flag that controls the joint's behaviour. */
-		virtual void setFlag(Flag flag, bool enabled) = 0;
+		virtual void setFlag(SliderJointFlag flag, bool enabled) = 0;
 
 
 		/** Checks is the specified flag enabled. */
 		/** Checks is the specified flag enabled. */
-		virtual bool hasFlag(Flag flag) const = 0;
+		virtual bool hasFlag(SliderJointFlag flag) const = 0;
 
 
 		/** Creates a new spherical joint. */
 		/** Creates a new spherical joint. */
 		static SPtr<SliderJoint> create(const SLIDER_JOINT_DESC& desc);
 		static SPtr<SliderJoint> create(const SLIDER_JOINT_DESC& desc);
@@ -65,7 +59,7 @@ namespace bs
 	struct SLIDER_JOINT_DESC : JOINT_DESC
 	struct SLIDER_JOINT_DESC : JOINT_DESC
 	{
 	{
 		LimitLinearRange limit;
 		LimitLinearRange limit;
-		SliderJoint::Flag flag = (SliderJoint::Flag)0;
+		SliderJointFlag flag = (SliderJointFlag)0;
 	};
 	};
 
 
 	/** @} */
 	/** @} */

+ 12 - 16
Source/BansheeCore/Physics/BsSphericalJoint.h

@@ -13,6 +13,12 @@ namespace bs
 
 
 	struct SPHERICAL_JOINT_DESC;
 	struct SPHERICAL_JOINT_DESC;
 
 
+	/** Flags that control options for the spherical joint */
+	enum class BS_SCRIPT_EXPORT(m:Physics) SphericalJointFlag
+	{
+		Limit = 0x1 /**< Enables the cone range limit. */
+	};
+
 	/** 
 	/** 
 	 * A spherical joint removes all translational degrees of freedom but allows all rotational degrees of freedom. 
 	 * A spherical joint removes all translational degrees of freedom but allows all rotational degrees of freedom. 
 	 * Essentially this ensures that the anchor points of the two bodies are always coincident. Bodies are allowed to
 	 * Essentially this ensures that the anchor points of the two bodies are always coincident. Bodies are allowed to
@@ -20,34 +26,24 @@ namespace bs
 	 */
 	 */
 	class BS_CORE_EXPORT SphericalJoint : public Joint
 	class BS_CORE_EXPORT SphericalJoint : public Joint
 	{
 	{
-	public:
-		/** Flags that control options for the spherical joint */
-		enum class Flag
-		{
-			Limit = 0x1 /**< Enables the cone range limit. */
-		};
-
 	public:
 	public:
 		SphericalJoint(const SPHERICAL_JOINT_DESC& desc) { }
 		SphericalJoint(const SPHERICAL_JOINT_DESC& desc) { }
 		virtual ~SphericalJoint() { }
 		virtual ~SphericalJoint() { }
 
 
-		/** 
-		 * Returns the limit of the joint. This clamps the rotation inside an eliptical angular cone. You must enable limit
-		 * flag on the joint in order for this to be recognized. 
-		 */
+		/** @copydoc setLimit() */
 		virtual LimitConeRange getLimit() const = 0;
 		virtual LimitConeRange getLimit() const = 0;
 
 
 		/** 
 		/** 
-		 * Sets the limit of the joint. This clamps the rotation inside an eliptical angular cone. You must enable limit
-		 * flag on the joint in order for this to be recognized. 
+		 * Determines the limit of the joint. This clamps the rotation inside an eliptical angular cone. You must enable
+		 * limit flag on the joint in order for this to be recognized. 
 		 */
 		 */
 		virtual void setLimit(const LimitConeRange& limit) = 0;
 		virtual void setLimit(const LimitConeRange& limit) = 0;
 
 
 		/** Enables or disables a flag that controls the joint's behaviour. */
 		/** Enables or disables a flag that controls the joint's behaviour. */
-		virtual void setFlag(Flag flag, bool enabled) = 0;
+		virtual void setFlag(SphericalJointFlag flag, bool enabled) = 0;
 
 
 		/** Checks is the specified flag enabled. */
 		/** Checks is the specified flag enabled. */
-		virtual bool hasFlag(Flag flag) const = 0;
+		virtual bool hasFlag(SphericalJointFlag flag) const = 0;
 
 
 		/** Creates a new spherical joint. */
 		/** Creates a new spherical joint. */
 		static SPtr<SphericalJoint> create(const SPHERICAL_JOINT_DESC& desc);
 		static SPtr<SphericalJoint> create(const SPHERICAL_JOINT_DESC& desc);
@@ -57,7 +53,7 @@ namespace bs
 	struct SPHERICAL_JOINT_DESC : JOINT_DESC
 	struct SPHERICAL_JOINT_DESC : JOINT_DESC
 	{
 	{
 		LimitConeRange limit;
 		LimitConeRange limit;
-		SphericalJoint::Flag flag = (SphericalJoint::Flag)0;
+		SphericalJointFlag flag = (SphericalJointFlag)0;
 	};
 	};
 
 
 	/** @} */
 	/** @} */

+ 4 - 4
Source/BansheeCore/RTTI/BsCD6JointRTTI.h

@@ -16,9 +16,9 @@ namespace bs
 
 
 	class BS_CORE_EXPORT CD6JointRTTI : public RTTIType<CD6Joint, CJoint, CD6JointRTTI>
 	class BS_CORE_EXPORT CD6JointRTTI : public RTTIType<CD6Joint, CJoint, CD6JointRTTI>
 	{
 	{
-		D6Joint::Motion& getMotion(CD6Joint* obj, UINT32 idx) { return obj->mDesc.motion[idx]; }
-		void setMotion(CD6Joint* obj, UINT32 idx, D6Joint::Motion& value) { obj->mDesc.motion[idx] = value; }
-		UINT32 getMotionCount(CD6Joint* obj) { return (UINT32)D6Joint::Motion::Count; }
+		D6JointMotion& getMotion(CD6Joint* obj, UINT32 idx) { return obj->mDesc.motion[idx]; }
+		void setMotion(CD6Joint* obj, UINT32 idx, D6JointMotion& value) { obj->mDesc.motion[idx] = value; }
+		UINT32 getMotionCount(CD6Joint* obj) { return (UINT32)D6JointMotion::Count; }
 		void setMotionCount(CD6Joint* obj, UINT32 size) { /* Do nothing */ }
 		void setMotionCount(CD6Joint* obj, UINT32 size) { /* Do nothing */ }
 
 
 		float& getDriveStiffness(CD6Joint* obj, UINT32 idx) { return obj->mDesc.drive[idx].stiffness; }
 		float& getDriveStiffness(CD6Joint* obj, UINT32 idx) { return obj->mDesc.drive[idx].stiffness; }
@@ -33,7 +33,7 @@ namespace bs
 		bool& getDriveAcceleration(CD6Joint* obj, UINT32 idx) { return obj->mDesc.drive[idx].acceleration; }
 		bool& getDriveAcceleration(CD6Joint* obj, UINT32 idx) { return obj->mDesc.drive[idx].acceleration; }
 		void setDriveAcceleration(CD6Joint* obj, UINT32 idx, bool& value) { obj->mDesc.drive[idx].acceleration = value; }
 		void setDriveAcceleration(CD6Joint* obj, UINT32 idx, bool& value) { obj->mDesc.drive[idx].acceleration = value; }
 
 
-		UINT32 getDriveCount(CD6Joint* obj) { return (UINT32)D6Joint::DriveType::Count; }
+		UINT32 getDriveCount(CD6Joint* obj) { return (UINT32)D6JointDriveType::Count; }
 		void setDriveCount(CD6Joint* obj, UINT32 size) { /* Do nothing */ }
 		void setDriveCount(CD6Joint* obj, UINT32 size) { /* Do nothing */ }
 
 
 		BS_BEGIN_RTTI_MEMBERS
 		BS_BEGIN_RTTI_MEMBERS

+ 1 - 1
Source/BansheeCore/Renderer/BsReflectionProbe.h

@@ -16,7 +16,7 @@ namespace bs
 	 */
 	 */
 
 
 	/** Light type that determines how is light information parsed by the renderer and other systems. */
 	/** Light type that determines how is light information parsed by the renderer and other systems. */
-	enum BS_SCRIPT_EXPORT() class ReflectionProbeType
+	enum BS_SCRIPT_EXPORT(m:Rendering) class ReflectionProbeType
 	{
 	{
 		/**
 		/**
 		 * Reflection probe cubemap is generated, and box extents are used for calculating influence ranges and box 
 		 * Reflection probe cubemap is generated, and box extents are used for calculating influence ranges and box 

+ 1 - 1
Source/BansheeCore/Renderer/BsRendererMeshData.h

@@ -39,7 +39,7 @@ namespace bs
 	};
 	};
 
 
 	/** Contains mesh vertex and index data used for initializing, updating and reading mesh data from Mesh. */
 	/** Contains mesh vertex and index data used for initializing, updating and reading mesh data from Mesh. */
-	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(n:MeshData) RendererMeshData
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Rendering,n:MeshData) RendererMeshData
 	{
 	{
 	public:
 	public:
 		/**
 		/**

+ 2 - 2
Source/BansheeCore/Utility/BsCommonTypes.h

@@ -132,7 +132,7 @@ namespace bs
 	};
 	};
 
 
 	/**	Type of mesh indices used, used for determining maximum number of vertices in a mesh. */
 	/**	Type of mesh indices used, used for determining maximum number of vertices in a mesh. */
-	enum BS_SCRIPT_EXPORT() IndexType
+	enum BS_SCRIPT_EXPORT(m:Rendering) IndexType
 	{
 	{
 		IT_16BIT	BS_SCRIPT_EXPORT(n:Index16),	/**< 16-bit indices. */
 		IT_16BIT	BS_SCRIPT_EXPORT(n:Index16),	/**< 16-bit indices. */
 		IT_32BIT	BS_SCRIPT_EXPORT(n:Index32)		/**< 32-bit indices. */
 		IT_32BIT	BS_SCRIPT_EXPORT(n:Index32)		/**< 32-bit indices. */
@@ -337,7 +337,7 @@ namespace bs
 	};
 	};
 
 
 	/**	Available texture types. */
 	/**	Available texture types. */
-	enum BS_SCRIPT_EXPORT() TextureType
+	enum BS_SCRIPT_EXPORT(m:Rendering) TextureType
 	{
 	{
 		/** One dimensional texture. Just a row of pixels. */
 		/** One dimensional texture. Just a row of pixels. */
 		TEX_TYPE_1D			BS_SCRIPT_EXPORT(n:Texture1D)	= 1, 
 		TEX_TYPE_1D			BS_SCRIPT_EXPORT(n:Texture1D)	= 1, 

+ 5 - 5
Source/BansheePhysX/BsPhysX.cpp

@@ -618,12 +618,12 @@ namespace bs
 
 
 	void PhysX::triggerEvents()
 	void PhysX::triggerEvents()
 	{
 	{
-		CollisionData data;
+		CollisionDataRaw data;
 
 
 		for(auto& entry : mTriggerEvents)
 		for(auto& entry : mTriggerEvents)
 		{
 		{
-			data.collidersRaw[0] = entry.trigger;
-			data.collidersRaw[1] = entry.other;
+			data.colliders[0] = entry.trigger;
+			data.colliders[1] = entry.other;
 
 
 			switch (entry.type)
 			switch (entry.type)
 			{
 			{
@@ -642,8 +642,8 @@ namespace bs
 		auto notifyContact = [&](Collider* obj, Collider* other, ContactEventType type, 
 		auto notifyContact = [&](Collider* obj, Collider* other, ContactEventType type, 
 			const Vector<ContactPoint>& points, bool flipNormals = false)
 			const Vector<ContactPoint>& points, bool flipNormals = false)
 		{
 		{
-			data.collidersRaw[0] = obj;
-			data.collidersRaw[1] = other;
+			data.colliders[0] = obj;
+			data.colliders[1] = other;
 			data.contactPoints = points;
 			data.contactPoints = points;
 
 
 			if(flipNormals)
 			if(flipNormals)

+ 38 - 38
Source/BansheePhysX/BsPhysXD6Joint.cpp

@@ -10,92 +10,92 @@ using namespace physx;
 
 
 namespace bs
 namespace bs
 {
 {
-	PxD6Axis::Enum toPxAxis(PhysXD6Joint::Axis axis)
+	PxD6Axis::Enum toPxAxis(D6JointAxis axis)
 	{
 	{
 		switch(axis)
 		switch(axis)
 		{
 		{
 		default:
 		default:
-		case PhysXD6Joint::Axis::X:
+		case D6JointAxis::X:
 			return PxD6Axis::eX;
 			return PxD6Axis::eX;
-		case PhysXD6Joint::Axis::Y:
+		case D6JointAxis::Y:
 			return PxD6Axis::eY;
 			return PxD6Axis::eY;
-		case PhysXD6Joint::Axis::Z:
+		case D6JointAxis::Z:
 			return PxD6Axis::eZ;
 			return PxD6Axis::eZ;
-		case PhysXD6Joint::Axis::Twist:
+		case D6JointAxis::Twist:
 			return PxD6Axis::eTWIST;
 			return PxD6Axis::eTWIST;
-		case PhysXD6Joint::Axis::SwingY:
+		case D6JointAxis::SwingY:
 			return PxD6Axis::eSWING1;
 			return PxD6Axis::eSWING1;
-		case PhysXD6Joint::Axis::SwingZ:
+		case D6JointAxis::SwingZ:
 			return PxD6Axis::eSWING2;
 			return PxD6Axis::eSWING2;
 		}
 		}
 	}
 	}
 
 
-	PxD6Motion::Enum toPxMotion(PhysXD6Joint::Motion motion)
+	PxD6Motion::Enum toPxMotion(D6JointMotion motion)
 	{
 	{
 		switch(motion)
 		switch(motion)
 		{
 		{
 		default:
 		default:
-		case PhysXD6Joint::Motion::Free:
+		case D6JointMotion::Free:
 			return PxD6Motion::eFREE;
 			return PxD6Motion::eFREE;
-		case PhysXD6Joint::Motion::Limited:
+		case D6JointMotion::Limited:
 			return PxD6Motion::eLIMITED;
 			return PxD6Motion::eLIMITED;
-		case PhysXD6Joint::Motion::Locked:
+		case D6JointMotion::Locked:
 			return PxD6Motion::eLOCKED;
 			return PxD6Motion::eLOCKED;
 		}
 		}
 	}
 	}
 
 
-	PxD6Drive::Enum toPxDrive(PhysXD6Joint::DriveType drive)
+	PxD6Drive::Enum toPxDrive(D6JointDriveType drive)
 	{
 	{
 		switch(drive)
 		switch(drive)
 		{
 		{
 		default:
 		default:
-		case PhysXD6Joint::DriveType::X:
+		case D6JointDriveType::X:
 			return PxD6Drive::eX;
 			return PxD6Drive::eX;
-		case PhysXD6Joint::DriveType::Y:
+		case D6JointDriveType::Y:
 			return PxD6Drive::eY;
 			return PxD6Drive::eY;
-		case PhysXD6Joint::DriveType::Z:
+		case D6JointDriveType::Z:
 			return PxD6Drive::eZ;
 			return PxD6Drive::eZ;
-		case PhysXD6Joint::DriveType::Swing:
+		case D6JointDriveType::Swing:
 			return PxD6Drive::eSWING;
 			return PxD6Drive::eSWING;
-		case PhysXD6Joint::DriveType::Twist:
+		case D6JointDriveType::Twist:
 			return PxD6Drive::eTWIST;
 			return PxD6Drive::eTWIST;
-		case PhysXD6Joint::DriveType::SLERP:
+		case D6JointDriveType::SLERP:
 			return PxD6Drive::eSLERP;
 			return PxD6Drive::eSLERP;
 		}
 		}
 	}
 	}
 
 
-	PhysXD6Joint::Motion fromPxMotion(PxD6Motion::Enum motion)
+	D6JointMotion fromPxMotion(PxD6Motion::Enum motion)
 	{
 	{
 		switch (motion)
 		switch (motion)
 		{
 		{
 		default:
 		default:
 		case PxD6Motion::eFREE:
 		case PxD6Motion::eFREE:
-			return PhysXD6Joint::Motion::Free;
+			return D6JointMotion::Free;
 		case PxD6Motion::eLIMITED:
 		case PxD6Motion::eLIMITED:
-			return PhysXD6Joint::Motion::Limited;
+			return D6JointMotion::Limited;
 		case PxD6Motion::eLOCKED:
 		case PxD6Motion::eLOCKED:
-			return PhysXD6Joint::Motion::Locked;
+			return D6JointMotion::Locked;
 		}
 		}
 	}
 	}
 
 
 
 
-	PhysXD6Joint::DriveType fromPxDrive(PxD6Drive::Enum drive)
+	D6JointDriveType fromPxDrive(PxD6Drive::Enum drive)
 	{
 	{
 		switch (drive)
 		switch (drive)
 		{
 		{
 		default:
 		default:
 		case PxD6Drive::eX:
 		case PxD6Drive::eX:
-			return PhysXD6Joint::DriveType::X;
+			return D6JointDriveType::X;
 		case PxD6Drive::eY:
 		case PxD6Drive::eY:
-			return PhysXD6Joint::DriveType::Y;
+			return D6JointDriveType::Y;
 		case PxD6Drive::eZ:
 		case PxD6Drive::eZ:
-			return PhysXD6Joint::DriveType::Z;
+			return D6JointDriveType::Z;
 		case PxD6Drive::eSWING:
 		case PxD6Drive::eSWING:
-			return PhysXD6Joint::DriveType::Swing;
+			return D6JointDriveType::Swing;
 		case PxD6Drive::eTWIST:
 		case PxD6Drive::eTWIST:
-			return PhysXD6Joint::DriveType::Twist;
+			return D6JointDriveType::Twist;
 		case PxD6Drive::eSLERP:
 		case PxD6Drive::eSLERP:
-			return PhysXD6Joint::DriveType::SLERP;
+			return D6JointDriveType::SLERP;
 		}
 		}
 	}
 	}
 
 
@@ -119,11 +119,11 @@ namespace bs
 		mInternal = bs_new<FPhysXJoint>(joint, desc);
 		mInternal = bs_new<FPhysXJoint>(joint, desc);
 
 
 		// Calls to virtual methods are okay here
 		// Calls to virtual methods are okay here
-		for (UINT32 i = 0; i < (UINT32)Axis::Count; i++)
-			setMotion((Axis)i, desc.motion[i]);
+		for (UINT32 i = 0; i < (UINT32)D6JointAxis::Count; i++)
+			setMotion((D6JointAxis)i, desc.motion[i]);
 
 
-		for (UINT32 i = 0; i < (UINT32)DriveType::Count; i++)
-			setDrive((DriveType)i, desc.drive[i]);
+		for (UINT32 i = 0; i < (UINT32)D6JointDriveType::Count; i++)
+			setDrive((D6JointDriveType)i, desc.drive[i]);
 
 
 		setLimitLinear(desc.limitLinear);
 		setLimitLinear(desc.limitLinear);
 		setLimitTwist(desc.limitTwist);
 		setLimitTwist(desc.limitTwist);
@@ -138,12 +138,12 @@ namespace bs
 		bs_delete(mInternal);
 		bs_delete(mInternal);
 	}
 	}
 
 
-	PhysXD6Joint::Motion PhysXD6Joint::getMotion(Axis axis) const
+	D6JointMotion PhysXD6Joint::getMotion(D6JointAxis axis) const
 	{
 	{
 		return fromPxMotion(getInternal()->getMotion(toPxAxis(axis)));
 		return fromPxMotion(getInternal()->getMotion(toPxAxis(axis)));
 	}
 	}
 
 
-	void PhysXD6Joint::setMotion(Axis axis, Motion motion)
+	void PhysXD6Joint::setMotion(D6JointAxis axis, D6JointMotion motion)
 	{
 	{
 		getInternal()->setMotion(toPxAxis(axis), toPxMotion(motion));
 		getInternal()->setMotion(toPxAxis(axis), toPxMotion(motion));
 	}
 	}
@@ -237,11 +237,11 @@ namespace bs
 		getInternal()->setSwingLimit(pxLimit);
 		getInternal()->setSwingLimit(pxLimit);
 	}
 	}
 
 
-	PhysXD6Joint::Drive PhysXD6Joint::getDrive(DriveType type) const
+	D6JointDrive PhysXD6Joint::getDrive(D6JointDriveType type) const
 	{
 	{
 		PxD6JointDrive pxDrive = getInternal()->getDrive(toPxDrive(type));
 		PxD6JointDrive pxDrive = getInternal()->getDrive(toPxDrive(type));
 
 
-		Drive drive;
+		D6JointDrive drive;
 		drive.acceleration = pxDrive.flags & PxD6JointDriveFlag::eACCELERATION;
 		drive.acceleration = pxDrive.flags & PxD6JointDriveFlag::eACCELERATION;
 		drive.stiffness = pxDrive.stiffness;
 		drive.stiffness = pxDrive.stiffness;
 		drive.damping = pxDrive.damping;
 		drive.damping = pxDrive.damping;
@@ -250,7 +250,7 @@ namespace bs
 		return drive;
 		return drive;
 	}
 	}
 
 
-	void PhysXD6Joint::setDrive(DriveType type, const Drive& drive)
+	void PhysXD6Joint::setDrive(D6JointDriveType type, const D6JointDrive& drive)
 	{
 	{
 		PxD6JointDrive pxDrive;
 		PxD6JointDrive pxDrive;
 
 

+ 4 - 4
Source/BansheePhysX/BsPhysXD6Joint.h

@@ -21,10 +21,10 @@ namespace bs
 		~PhysXD6Joint();
 		~PhysXD6Joint();
 
 
 		/** @copydoc D6Joint::getMotion */
 		/** @copydoc D6Joint::getMotion */
-		Motion getMotion(Axis axis) const override;
+		D6JointMotion getMotion(D6JointAxis axis) const override;
 
 
 		/** @copydoc D6Joint::setMotion */
 		/** @copydoc D6Joint::setMotion */
-		void setMotion(Axis axis, Motion motion) override;
+		void setMotion(D6JointAxis axis, D6JointMotion motion) override;
 
 
 		/** @copydoc D6Joint::getTwist */
 		/** @copydoc D6Joint::getTwist */
 		Radian getTwist() const override;
 		Radian getTwist() const override;
@@ -54,10 +54,10 @@ namespace bs
 		void setLimitSwing(const LimitConeRange& limit) override;
 		void setLimitSwing(const LimitConeRange& limit) override;
 
 
 		/** @copydoc D6Joint::getDrive */
 		/** @copydoc D6Joint::getDrive */
-		Drive getDrive(DriveType type) const override;
+		D6JointDrive getDrive(D6JointDriveType type) const override;
 
 
 		/** @copydoc D6Joint::setDrive */
 		/** @copydoc D6Joint::setDrive */
-		void setDrive(DriveType type, const Drive& drive) override;
+		void setDrive(D6JointDriveType type, const D6JointDrive& drive) override;
 
 
 		/** @copydoc D6Joint::getDrivePosition */
 		/** @copydoc D6Joint::getDrivePosition */
 		Vector3 getDrivePosition() const override;
 		Vector3 getDrivePosition() const override;

+ 9 - 9
Source/BansheePhysX/BsPhysXDistanceJoint.cpp

@@ -9,16 +9,16 @@ using namespace physx;
 
 
 namespace bs
 namespace bs
 {
 {
-	PxDistanceJointFlag::Enum toPxFlag(PhysXDistanceJoint::Flag flag)
+	PxDistanceJointFlag::Enum toPxFlag(DistanceJointFlag flag)
 	{
 	{
 		switch (flag)
 		switch (flag)
 		{
 		{
-		case PhysXDistanceJoint::Flag::MaxDistance:
+		case DistanceJointFlag::MaxDistance:
 			return PxDistanceJointFlag::eMAX_DISTANCE_ENABLED;
 			return PxDistanceJointFlag::eMAX_DISTANCE_ENABLED;
-		case PhysXDistanceJoint::Flag::MinDistance:
+		case DistanceJointFlag::MinDistance:
 			return PxDistanceJointFlag::eMIN_DISTANCE_ENABLED;
 			return PxDistanceJointFlag::eMIN_DISTANCE_ENABLED;
 		default:
 		default:
-		case PhysXDistanceJoint::Flag::Spring:
+		case DistanceJointFlag::Spring:
 			return PxDistanceJointFlag::eSPRING_ENABLED;
 			return PxDistanceJointFlag::eSPRING_ENABLED;
 		}
 		}
 	}
 	}
@@ -50,13 +50,13 @@ namespace bs
 		
 		
 		PxDistanceJointFlags flags;
 		PxDistanceJointFlags flags;
 		
 		
-		if(((UINT32)desc.flag & (UINT32)Flag::MaxDistance) != 0)
+		if(((UINT32)desc.flag & (UINT32)DistanceJointFlag::MaxDistance) != 0)
 			flags |= PxDistanceJointFlag::eMAX_DISTANCE_ENABLED;
 			flags |= PxDistanceJointFlag::eMAX_DISTANCE_ENABLED;
 
 
-		if (((UINT32)desc.flag & (UINT32)Flag::MinDistance) != 0)
+		if (((UINT32)desc.flag & (UINT32)DistanceJointFlag::MinDistance) != 0)
 			flags |= PxDistanceJointFlag::eMIN_DISTANCE_ENABLED;
 			flags |= PxDistanceJointFlag::eMIN_DISTANCE_ENABLED;
 
 
-		if (((UINT32)desc.flag & (UINT32)Flag::Spring) != 0)
+		if (((UINT32)desc.flag & (UINT32)DistanceJointFlag::Spring) != 0)
 			flags |= PxDistanceJointFlag::eSPRING_ENABLED;
 			flags |= PxDistanceJointFlag::eSPRING_ENABLED;
 
 
 		joint->setDistanceJointFlags(flags);
 		joint->setDistanceJointFlags(flags);
@@ -116,12 +116,12 @@ namespace bs
 		getInternal()->setStiffness(value.stiffness);
 		getInternal()->setStiffness(value.stiffness);
 	}
 	}
 
 
-	void PhysXDistanceJoint::setFlag(Flag flag, bool enabled)
+	void PhysXDistanceJoint::setFlag(DistanceJointFlag flag, bool enabled)
 	{
 	{
 		getInternal()->setDistanceJointFlag(toPxFlag(flag), enabled);
 		getInternal()->setDistanceJointFlag(toPxFlag(flag), enabled);
 	}
 	}
 
 
-	bool PhysXDistanceJoint::hasFlag(Flag flag) const
+	bool PhysXDistanceJoint::hasFlag(DistanceJointFlag flag) const
 	{
 	{
 		return getInternal()->getDistanceJointFlags() & toPxFlag(flag);
 		return getInternal()->getDistanceJointFlags() & toPxFlag(flag);
 	}
 	}

+ 2 - 2
Source/BansheePhysX/BsPhysXDistanceJoint.h

@@ -48,10 +48,10 @@ namespace bs
 		void setSpring(const Spring& value) override;
 		void setSpring(const Spring& value) override;
 
 
 		/** @copydoc DistanceJoint::setFlag */
 		/** @copydoc DistanceJoint::setFlag */
-		void setFlag(Flag flag, bool enabled) override;
+		void setFlag(DistanceJointFlag flag, bool enabled) override;
 
 
 		/** @copydoc DistanceJoint::hasFlag */
 		/** @copydoc DistanceJoint::hasFlag */
-		bool hasFlag(Flag flag) const override;
+		bool hasFlag(DistanceJointFlag flag) const override;
 
 
 	private:
 	private:
 		/** Returns the internal PhysX representation of the distance joint. */
 		/** Returns the internal PhysX representation of the distance joint. */

+ 10 - 10
Source/BansheePhysX/BsPhysXHingeJoint.cpp

@@ -9,14 +9,14 @@ using namespace physx;
 
 
 namespace bs
 namespace bs
 {
 {
-	PxRevoluteJointFlag::Enum toPxFlag(PhysXHingeJoint::Flag flag)
+	PxRevoluteJointFlag::Enum toPxFlag(HingeJointFlag flag)
 	{
 	{
 		switch (flag)
 		switch (flag)
 		{
 		{
-		case PhysXHingeJoint::Flag::Limit:
+		case HingeJointFlag::Limit:
 			return PxRevoluteJointFlag::eLIMIT_ENABLED;
 			return PxRevoluteJointFlag::eLIMIT_ENABLED;
 		default:
 		default:
-		case PhysXHingeJoint::Flag::Drive:
+		case HingeJointFlag::Drive:
 			return PxRevoluteJointFlag::eDRIVE_ENABLED;
 			return PxRevoluteJointFlag::eDRIVE_ENABLED;
 		}
 		}
 	}
 	}
@@ -42,10 +42,10 @@ namespace bs
 
 
 		PxRevoluteJointFlags flags;
 		PxRevoluteJointFlags flags;
 
 
-		if (((UINT32)desc.flag & (UINT32)Flag::Limit) != 0)
+		if (((UINT32)desc.flag & (UINT32)HingeJointFlag::Limit) != 0)
 			flags |= PxRevoluteJointFlag::eLIMIT_ENABLED;
 			flags |= PxRevoluteJointFlag::eLIMIT_ENABLED;
 
 
-		if (((UINT32)desc.flag & (UINT32)Flag::Drive) != 0)
+		if (((UINT32)desc.flag & (UINT32)HingeJointFlag::Drive) != 0)
 			flags |= PxRevoluteJointFlag::eDRIVE_ENABLED;
 			flags |= PxRevoluteJointFlag::eDRIVE_ENABLED;
 
 
 		joint->setRevoluteJointFlags(flags);
 		joint->setRevoluteJointFlags(flags);
@@ -96,9 +96,9 @@ namespace bs
 		getInternal()->setLimit(pxLimit);
 		getInternal()->setLimit(pxLimit);
 	}
 	}
 
 
-	PhysXHingeJoint::Drive PhysXHingeJoint::getDrive() const
+	HingeJointDrive PhysXHingeJoint::getDrive() const
 	{
 	{
-		Drive drive;
+		HingeJointDrive drive;
 		drive.speed = getInternal()->getDriveVelocity();
 		drive.speed = getInternal()->getDriveVelocity();
 		drive.forceLimit = getInternal()->getDriveForceLimit();
 		drive.forceLimit = getInternal()->getDriveForceLimit();
 		drive.gearRatio = getInternal()->getDriveGearRatio();
 		drive.gearRatio = getInternal()->getDriveGearRatio();
@@ -107,7 +107,7 @@ namespace bs
 		return drive;
 		return drive;
 	}
 	}
 
 
-	void PhysXHingeJoint::setDrive(const Drive& drive)
+	void PhysXHingeJoint::setDrive(const HingeJointDrive& drive)
 	{
 	{
 		getInternal()->setDriveVelocity(drive.speed);
 		getInternal()->setDriveVelocity(drive.speed);
 		getInternal()->setDriveForceLimit(drive.forceLimit);
 		getInternal()->setDriveForceLimit(drive.forceLimit);
@@ -115,12 +115,12 @@ namespace bs
 		getInternal()->setRevoluteJointFlag(PxRevoluteJointFlag::eDRIVE_FREESPIN, drive.freeSpin);
 		getInternal()->setRevoluteJointFlag(PxRevoluteJointFlag::eDRIVE_FREESPIN, drive.freeSpin);
 	}
 	}
 
 
-	void PhysXHingeJoint::setFlag(Flag flag, bool enabled)
+	void PhysXHingeJoint::setFlag(HingeJointFlag flag, bool enabled)
 	{
 	{
 		getInternal()->setRevoluteJointFlag(toPxFlag(flag), enabled);
 		getInternal()->setRevoluteJointFlag(toPxFlag(flag), enabled);
 	}
 	}
 
 
-	bool PhysXHingeJoint::hasFlag(Flag flag) const
+	bool PhysXHingeJoint::hasFlag(HingeJointFlag flag) const
 	{
 	{
 		return getInternal()->getRevoluteJointFlags() & toPxFlag(flag);
 		return getInternal()->getRevoluteJointFlags() & toPxFlag(flag);
 	}
 	}

+ 4 - 4
Source/BansheePhysX/BsPhysXHingeJoint.h

@@ -33,16 +33,16 @@ namespace bs
 		void setLimit(const LimitAngularRange& limit) override;
 		void setLimit(const LimitAngularRange& limit) override;
 
 
 		/** @copydoc HingeJoint::getDrive */
 		/** @copydoc HingeJoint::getDrive */
-		Drive getDrive() const override;
+		HingeJointDrive getDrive() const override;
 
 
 		/** @copydoc HingeJoint::setDrive */
 		/** @copydoc HingeJoint::setDrive */
-		void setDrive(const Drive& drive) override;
+		void setDrive(const HingeJointDrive& drive) override;
 
 
 		/** @copydoc HingeJoint::setFlag */
 		/** @copydoc HingeJoint::setFlag */
-		void setFlag(Flag flag, bool enabled) override;
+		void setFlag(HingeJointFlag flag, bool enabled) override;
 
 
 		/** @copydoc HingeJoint::hasFlag */
 		/** @copydoc HingeJoint::hasFlag */
-		bool hasFlag(Flag flag) const override;
+		bool hasFlag(HingeJointFlag flag) const override;
 
 
 	private:
 	private:
 		/** Returns the internal PhysX representation of the hinge (revolute) joint. */
 		/** Returns the internal PhysX representation of the hinge (revolute) joint. */

+ 8 - 8
Source/BansheePhysX/BsPhysXRigidbody.cpp

@@ -112,7 +112,7 @@ namespace bs
 
 
 	void PhysXRigidbody::setMass(float mass)
 	void PhysXRigidbody::setMass(float mass)
 	{
 	{
-		if(((UINT32)mFlags & (UINT32)Flag::AutoMass) != 0)
+		if(((UINT32)mFlags & (UINT32)RigidbodyFlag::AutoMass) != 0)
 		{
 		{
 			LOGWRN("Attempting to set Rigidbody mass, but it has automatic mass calculation turned on.");
 			LOGWRN("Attempting to set Rigidbody mass, but it has automatic mass calculation turned on.");
 			return;
 			return;
@@ -213,7 +213,7 @@ namespace bs
 
 
 	void PhysXRigidbody::setInertiaTensor(const Vector3& tensor)
 	void PhysXRigidbody::setInertiaTensor(const Vector3& tensor)
 	{
 	{
-		if (((UINT32)mFlags & (UINT32)Flag::AutoTensors) != 0)
+		if (((UINT32)mFlags & (UINT32)RigidbodyFlag::AutoTensors) != 0)
 		{
 		{
 			LOGWRN("Attempting to set Rigidbody inertia tensor, but it has automatic tensor calculation turned on.");
 			LOGWRN("Attempting to set Rigidbody inertia tensor, but it has automatic tensor calculation turned on.");
 			return;
 			return;
@@ -239,7 +239,7 @@ namespace bs
 
 
 	void PhysXRigidbody::setCenterOfMass(const Vector3& position, const Quaternion& rotation)
 	void PhysXRigidbody::setCenterOfMass(const Vector3& position, const Quaternion& rotation)
 	{
 	{
-		if (((UINT32)mFlags & (UINT32)Flag::AutoTensors) != 0)
+		if (((UINT32)mFlags & (UINT32)RigidbodyFlag::AutoTensors) != 0)
 		{
 		{
 			LOGWRN("Attempting to set Rigidbody center of mass, but it has automatic tensor calculation turned on.");
 			LOGWRN("Attempting to set Rigidbody center of mass, but it has automatic tensor calculation turned on.");
 			return;
 			return;
@@ -288,10 +288,10 @@ namespace bs
 		return velCount;
 		return velCount;
 	}
 	}
 
 
-	void PhysXRigidbody::setFlags(Flag flags)
+	void PhysXRigidbody::setFlags(RigidbodyFlag flags)
 	{
 	{
 		bool ccdEnabledOld = mInternal->getRigidBodyFlags() & PxRigidBodyFlag::eENABLE_CCD;
 		bool ccdEnabledOld = mInternal->getRigidBodyFlags() & PxRigidBodyFlag::eENABLE_CCD;
-		bool ccdEnabledNew = ((UINT32)flags & (UINT32)Flag::CCD) != 0;
+		bool ccdEnabledNew = ((UINT32)flags & (UINT32)RigidbodyFlag::CCD) != 0;
 		
 		
 		if(ccdEnabledOld != ccdEnabledNew)
 		if(ccdEnabledOld != ccdEnabledNew)
 		{
 		{
@@ -360,10 +360,10 @@ namespace bs
 
 
 	void PhysXRigidbody::updateMassDistribution() 
 	void PhysXRigidbody::updateMassDistribution() 
 	{
 	{
-		if (((UINT32)mFlags & (UINT32)Flag::AutoTensors) == 0)
+		if (((UINT32)mFlags & (UINT32)RigidbodyFlag::AutoTensors) == 0)
 			return;
 			return;
 
 
-		if (((UINT32)mFlags & (UINT32)Flag::AutoMass) == 0)
+		if (((UINT32)mFlags & (UINT32)RigidbodyFlag::AutoMass) == 0)
 		{
 		{
 			PxRigidBodyExt::setMassAndUpdateInertia(*mInternal, mInternal->getMass());
 			PxRigidBodyExt::setMassAndUpdateInertia(*mInternal, mInternal->getMass());
 		}
 		}
@@ -396,7 +396,7 @@ namespace bs
 			return;
 			return;
 
 
 		FPhysXCollider* physxCollider = static_cast<FPhysXCollider*>(collider);
 		FPhysXCollider* physxCollider = static_cast<FPhysXCollider*>(collider);
-		physxCollider->_setCCD(((UINT32)mFlags & (UINT32)Flag::CCD) != 0);
+		physxCollider->_setCCD(((UINT32)mFlags & (UINT32)RigidbodyFlag::CCD) != 0);
 
 
 		mInternal->attachShape(*physxCollider->_getShape());
 		mInternal->attachShape(*physxCollider->_getShape());
 	}
 	}

+ 1 - 1
Source/BansheePhysX/BsPhysXRigidbody.h

@@ -127,7 +127,7 @@ namespace bs
 		UINT32 getVelocitySolverCount() const override;
 		UINT32 getVelocitySolverCount() const override;
 
 
 		/** @copydoc Rigidbody::setFlags */
 		/** @copydoc Rigidbody::setFlags */
-		void setFlags(Flag flags) override;
+		void setFlags(RigidbodyFlag flags) override;
 
 
 		/** @copydoc Rigidbody::addForce */
 		/** @copydoc Rigidbody::addForce */
 		void addForce(const Vector3& force, ForceMode mode = ForceMode::Force) override;
 		void addForce(const Vector3& force, ForceMode mode = ForceMode::Force) override;

+ 5 - 5
Source/BansheePhysX/BsPhysXSliderJoint.cpp

@@ -10,12 +10,12 @@ using namespace physx;
 
 
 namespace bs
 namespace bs
 {
 {
-	PxPrismaticJointFlag::Enum toPxFlag(PhysXSliderJoint::Flag flag)
+	PxPrismaticJointFlag::Enum toPxFlag(SliderJointFlag flag)
 	{
 	{
 		switch (flag)
 		switch (flag)
 		{
 		{
 		default:
 		default:
-		case PhysXSliderJoint::Flag::Limit:
+		case SliderJointFlag::Limit:
 			return PxPrismaticJointFlag::eLIMIT_ENABLED;
 			return PxPrismaticJointFlag::eLIMIT_ENABLED;
 		}
 		}
 	}
 	}
@@ -41,7 +41,7 @@ namespace bs
 
 
 		PxPrismaticJointFlags flags;
 		PxPrismaticJointFlags flags;
 
 
-		if (((UINT32)desc.flag & (UINT32)Flag::Limit) != 0)
+		if (((UINT32)desc.flag & (UINT32)SliderJointFlag::Limit) != 0)
 			flags |= PxPrismaticJointFlag::eLIMIT_ENABLED;
 			flags |= PxPrismaticJointFlag::eLIMIT_ENABLED;
 
 
 		joint->setPrismaticJointFlags(flags);
 		joint->setPrismaticJointFlags(flags);
@@ -90,12 +90,12 @@ namespace bs
 		getInternal()->setLimit(pxLimit);
 		getInternal()->setLimit(pxLimit);
 	}
 	}
 
 
-	void PhysXSliderJoint::setFlag(Flag flag, bool enabled)
+	void PhysXSliderJoint::setFlag(SliderJointFlag flag, bool enabled)
 	{
 	{
 		getInternal()->setPrismaticJointFlag(toPxFlag(flag), enabled);
 		getInternal()->setPrismaticJointFlag(toPxFlag(flag), enabled);
 	}
 	}
 
 
-	bool PhysXSliderJoint::hasFlag(Flag flag) const
+	bool PhysXSliderJoint::hasFlag(SliderJointFlag flag) const
 	{
 	{
 		return getInternal()->getPrismaticJointFlags() & toPxFlag(flag);
 		return getInternal()->getPrismaticJointFlags() & toPxFlag(flag);
 	}
 	}

+ 2 - 2
Source/BansheePhysX/BsPhysXSliderJoint.h

@@ -33,10 +33,10 @@ namespace bs
 		void setLimit(const LimitLinearRange& limit) override;
 		void setLimit(const LimitLinearRange& limit) override;
 
 
 		/** @copydoc SliderJoint::setFlag */
 		/** @copydoc SliderJoint::setFlag */
-		void setFlag(Flag flag, bool enabled) override;
+		void setFlag(SliderJointFlag flag, bool enabled) override;
 
 
 		/** @copydoc SliderJoint::hasFlag */
 		/** @copydoc SliderJoint::hasFlag */
-		bool hasFlag(Flag flag) const override;
+		bool hasFlag(SliderJointFlag flag) const override;
 
 
 	private:
 	private:
 		/** Returns the internal PhysX representation of the slider (prismatic) joint. */
 		/** Returns the internal PhysX representation of the slider (prismatic) joint. */

+ 5 - 5
Source/BansheePhysX/BsPhysXSphericalJoint.cpp

@@ -9,12 +9,12 @@ using namespace physx;
 
 
 namespace bs
 namespace bs
 {
 {
-	PxSphericalJointFlag::Enum toPxFlag(PhysXSphericalJoint::Flag flag)
+	PxSphericalJointFlag::Enum toPxFlag(SphericalJointFlag flag)
 	{
 	{
 		switch (flag)
 		switch (flag)
 		{
 		{
 		default:
 		default:
-		case PhysXSphericalJoint::Flag::Limit:
+		case SphericalJointFlag::Limit:
 			return PxSphericalJointFlag::eLIMIT_ENABLED;
 			return PxSphericalJointFlag::eLIMIT_ENABLED;
 		}
 		}
 	}
 	}
@@ -40,7 +40,7 @@ namespace bs
 
 
 		PxSphericalJointFlags flags;
 		PxSphericalJointFlags flags;
 
 
-		if (((UINT32)desc.flag & (UINT32)Flag::Limit) != 0)
+		if (((UINT32)desc.flag & (UINT32)SphericalJointFlag::Limit) != 0)
 			flags |= PxSphericalJointFlag::eLIMIT_ENABLED;
 			flags |= PxSphericalJointFlag::eLIMIT_ENABLED;
 
 
 		joint->setSphericalJointFlags(flags);
 		joint->setSphericalJointFlags(flags);
@@ -79,12 +79,12 @@ namespace bs
 		getInternal()->setLimitCone(pxLimit);
 		getInternal()->setLimitCone(pxLimit);
 	}
 	}
 
 
-	void PhysXSphericalJoint::setFlag(Flag flag, bool enabled)
+	void PhysXSphericalJoint::setFlag(SphericalJointFlag flag, bool enabled)
 	{
 	{
 		getInternal()->setSphericalJointFlag(toPxFlag(flag), enabled);
 		getInternal()->setSphericalJointFlag(toPxFlag(flag), enabled);
 	}
 	}
 
 
-	bool PhysXSphericalJoint::hasFlag(Flag flag) const
+	bool PhysXSphericalJoint::hasFlag(SphericalJointFlag flag) const
 	{
 	{
 		return getInternal()->getSphericalJointFlags() & toPxFlag(flag);
 		return getInternal()->getSphericalJointFlags() & toPxFlag(flag);
 	}
 	}

+ 2 - 2
Source/BansheePhysX/BsPhysXSphericalJoint.h

@@ -27,10 +27,10 @@ namespace bs
 		void setLimit(const LimitConeRange& limit) override;
 		void setLimit(const LimitConeRange& limit) override;
 
 
 		/** @copydoc SphericalJoint::setFlag */
 		/** @copydoc SphericalJoint::setFlag */
-		void setFlag(Flag flag, bool enabled) override;
+		void setFlag(SphericalJointFlag flag, bool enabled) override;
 
 
 		/** @copydoc SphericalJoint::hasFlag */
 		/** @copydoc SphericalJoint::hasFlag */
-		bool hasFlag(Flag flag) const override;
+		bool hasFlag(SphericalJointFlag flag) const override;
 
 
 	private:
 	private:
 		/** Returns the internal PhysX representation of the spherical joint. */
 		/** Returns the internal PhysX representation of the spherical joint. */

+ 0 - 7
Source/BansheeUtility/Math/BsMath.cpp

@@ -8,13 +8,6 @@
 
 
 namespace bs
 namespace bs
 {
 {
-    const float Math::POS_INFINITY = std::numeric_limits<float>::infinity();
-    const float Math::NEG_INFINITY = -std::numeric_limits<float>::infinity();
-    const float Math::PI = (float)4.0f * std::atan(1.0f);
-    const float Math::TWO_PI = (float)(2.0f * PI);
-    const float Math::HALF_PI = (float)(0.5f * PI);
-	const float Math::DEG2RAD = PI / 180.0f;
-	const float Math::RAD2DEG = 180.0f / PI;
 	const float Math::LOG2 = std::log(2.0f);
 	const float Math::LOG2 = std::log(2.0f);
 
 
     Radian Math::acos(float val)
     Radian Math::acos(float val)

+ 8 - 8
Source/BansheeUtility/Math/BsMath.h

@@ -745,15 +745,15 @@ namespace bs
 			coefficients[3] = pointA;
 			coefficients[3] = pointA;
 		}
 		}
 
 
-        static const float POS_INFINITY;
-        static const float NEG_INFINITY;
-        static const float PI;
-        static const float TWO_PI;
-        static const float HALF_PI;
-		static const float DEG2RAD;
-		static const float RAD2DEG;
+		static constexpr float Math::POS_INFINITY = std::numeric_limits<float>::infinity();
+		static constexpr float Math::NEG_INFINITY = -std::numeric_limits<float>::infinity();
+		static constexpr float Math::PI = 3.14159265358979323846f;
+		static constexpr float Math::TWO_PI = (float)(2.0f * PI);
+		static constexpr float Math::HALF_PI = (float)(0.5f * PI);
+		static constexpr float Math::DEG2RAD = PI / 180.0f;
+		static constexpr float Math::RAD2DEG = 180.0f / PI;
 		static const float LOG2;
 		static const float LOG2;
-    };
+	};
 
 
 	/** @} */
 	/** @} */
 }
 }

+ 2 - 1
Source/BansheeUtility/Prerequisites/BsPrerequisitesUtil.h

@@ -239,7 +239,8 @@
  *		  parameter and return no values. Usable on methods only.
  *		  parameter and return no values. Usable on methods only.
  *	- ed - Specify that a type should be exported for use in the editor only. Supported values are "true" or "false".
  *	- ed - Specify that a type should be exported for use in the editor only. Supported values are "true" or "false".
  *		   Usable on types only.
  *		   Usable on types only.
- *  - ex - Excludes an enum member from being generated in script code. Supported values are "true" or "false".
+ *  - ex - Excludes an enum or struct member from being generated in script code. Supported values are "true" or "false".
+ *		   By default all struct & enum members are exported.
  *  - in - When enabled ensures only the interop C# method is generated, but not a public one. It is instead expected
  *  - in - When enabled ensures only the interop C# method is generated, but not a public one. It is instead expected
  *		   the user will manually implement the public method. Supported values are "true" or "false". Default is "false".
  *		   the user will manually implement the public method. Supported values are "true" or "false". Default is "false".
  *		   Only supported on methods.
  *		   Only supported on methods.

+ 1 - 1
Source/CMakeLists.txt

@@ -5,7 +5,7 @@ project (Banshee)
 set (BS_VERSION_MAJOR 0)
 set (BS_VERSION_MAJOR 0)
 set (BS_VERSION_MINOR 4)
 set (BS_VERSION_MINOR 4)
 
 
-set (BS_PREBUILT_DEPENDENCIES_VERSION 7)
+set (BS_PREBUILT_DEPENDENCIES_VERSION 8)
 set (BS_SRC_DEPENDENCIES_VERSION 12)
 set (BS_SRC_DEPENDENCIES_VERSION 12)
 
 
 # Configuration types
 # Configuration types

+ 1 - 1
Source/MBansheeEditor/Inspectors/AudioSourceInspector.cs

@@ -92,7 +92,7 @@ namespace BansheeEditor
                 ConfirmModify();
                 ConfirmModify();
             };
             };
 
 
-            priorityField.OnChanged += x => { source.Priority = x; MarkAsModified(); };
+            priorityField.OnChanged += x => { source.Priority = (uint)x; MarkAsModified(); };
             priorityField.OnConfirmed += ConfirmModify;
             priorityField.OnConfirmed += ConfirmModify;
             priorityField.OnFocusLost += ConfirmModify;
             priorityField.OnFocusLost += ConfirmModify;
 
 

+ 2 - 2
Source/MBansheeEditor/Inspectors/ColliderInspector.cs

@@ -33,7 +33,7 @@ namespace BansheeEditor
         /// <param name="collider">Collider to update the GUI from.</param>
         /// <param name="collider">Collider to update the GUI from.</param>
         protected virtual void Refresh(Collider collider)
         protected virtual void Refresh(Collider collider)
         {
         {
-            isTriggerField.Value = collider.IsTrigger;
+            isTriggerField.Value = collider.Trigger;
             massField.Value = collider.Mass;
             massField.Value = collider.Mass;
             materialField.Value = collider.Material;
             materialField.Value = collider.Material;
             contactOffsetField.Value = collider.ContactOffset;
             contactOffsetField.Value = collider.ContactOffset;
@@ -56,7 +56,7 @@ namespace BansheeEditor
         /// </summary>
         /// </summary>
         protected virtual void BuildGUI(Collider collider)
         protected virtual void BuildGUI(Collider collider)
         {
         {
-            isTriggerField.OnChanged += x => { collider.IsTrigger = x; MarkAsModified(); ConfirmModify(); };
+            isTriggerField.OnChanged += x => { collider.Trigger = x; MarkAsModified(); ConfirmModify(); };
 
 
             massField.OnChanged += x => { collider.Mass = x; MarkAsModified(); };
             massField.OnChanged += x => { collider.Mass = x; MarkAsModified(); };
             massField.OnConfirmed += ConfirmModify;
             massField.OnConfirmed += ConfirmModify;

+ 15 - 12
Source/MBansheeEditor/Inspectors/D6JointInspector.cs

@@ -105,19 +105,19 @@ namespace BansheeEditor
                 Persistent.SetBool("drive_Expanded", x);
                 Persistent.SetBool("drive_Expanded", x);
             };
             };
 
 
-            drivePositionField.OnChanged += x => { joint.DrivePosition = x; MarkAsModified(); };
+            drivePositionField.OnChanged += x => { joint.SetDriveTransform(x, joint.DriveRotation); MarkAsModified(); };
             drivePositionField.OnFocusLost += ConfirmModify;
             drivePositionField.OnFocusLost += ConfirmModify;
             drivePositionField.OnConfirmed += ConfirmModify;
             drivePositionField.OnConfirmed += ConfirmModify;
 
 
-            driveRotationField.OnChanged += x => { joint.DriveRotation = Quaternion.FromEuler(x); MarkAsModified(); };
+            driveRotationField.OnChanged += x => { joint.SetDriveTransform(joint.DrivePosition, Quaternion.FromEuler(x)); MarkAsModified(); };
             driveRotationField.OnFocusLost += ConfirmModify;
             driveRotationField.OnFocusLost += ConfirmModify;
             driveRotationField.OnConfirmed += ConfirmModify;
             driveRotationField.OnConfirmed += ConfirmModify;
 
 
-            driveLinVelocityField.OnChanged += x => { joint.DriveLinearVelocity = x; MarkAsModified(); };
+            driveLinVelocityField.OnChanged += x => { joint.SetDriveVelocity(x, joint.DriveAngularVelocity); MarkAsModified(); };
             driveLinVelocityField.OnFocusLost += ConfirmModify;
             driveLinVelocityField.OnFocusLost += ConfirmModify;
             driveLinVelocityField.OnConfirmed += ConfirmModify;
             driveLinVelocityField.OnConfirmed += ConfirmModify;
 
 
-            driveAngVelocityField.OnChanged += x => { joint.DriveAngularVelocity = x; MarkAsModified(); };
+            driveAngVelocityField.OnChanged += x => { joint.SetDriveVelocity(joint.DriveLinearVelocity, x); MarkAsModified(); };
             driveAngVelocityField.OnFocusLost += ConfirmModify;
             driveAngVelocityField.OnFocusLost += ConfirmModify;
             driveAngVelocityField.OnConfirmed += ConfirmModify;
             driveAngVelocityField.OnConfirmed += ConfirmModify;
 
 
@@ -132,7 +132,8 @@ namespace BansheeEditor
                 limitLinearGUI = new LimitLinearGUI(joint.LimitLinear, linearLimitContentsLayout, Persistent);
                 limitLinearGUI = new LimitLinearGUI(joint.LimitLinear, linearLimitContentsLayout, Persistent);
                 limitLinearGUI.OnChanged += (x, y) =>
                 limitLinearGUI.OnChanged += (x, y) =>
                 {
                 {
-                    joint.LimitLinear = new LimitLinear(x, y);
+                    joint.LimitLinear = x;
+                    joint.LimitLinear.SetBase(y);
 
 
                     MarkAsModified();
                     MarkAsModified();
                 };
                 };
@@ -147,7 +148,8 @@ namespace BansheeEditor
                 limitTwistGUI = new LimitAngularRangeGUI(joint.LimitTwist, twistLimitContentsLayout, Persistent);
                 limitTwistGUI = new LimitAngularRangeGUI(joint.LimitTwist, twistLimitContentsLayout, Persistent);
                 limitTwistGUI.OnChanged += (x, y) =>
                 limitTwistGUI.OnChanged += (x, y) =>
                 {
                 {
-                    joint.LimitTwist = new LimitAngularRange(x, y);
+                    joint.LimitTwist = x;
+                    joint.LimitTwist.SetBase(y);
 
 
                     MarkAsModified();
                     MarkAsModified();
                 };
                 };
@@ -162,7 +164,8 @@ namespace BansheeEditor
                 limitSwingGUI = new LimitConeRangeGUI(joint.LimitSwing, swingLimitContentsLayout, Persistent);
                 limitSwingGUI = new LimitConeRangeGUI(joint.LimitSwing, swingLimitContentsLayout, Persistent);
                 limitSwingGUI.OnChanged += (x, y) =>
                 limitSwingGUI.OnChanged += (x, y) =>
                 {
                 {
-                    joint.LimitSwing = new LimitConeRange(x, y);
+                    joint.LimitSwing = x;
+                    joint.LimitSwing.SetBase(y);
 
 
                     MarkAsModified();
                     MarkAsModified();
                 };
                 };
@@ -180,7 +183,7 @@ namespace BansheeEditor
                     D6JointDriveType type = (D6JointDriveType)i;
                     D6JointDriveType type = (D6JointDriveType)i;
 
 
                     drivesGUI[i] = new D6JointDriveGUI(joint.GetDrive(type), driveContentsLayout);
                     drivesGUI[i] = new D6JointDriveGUI(joint.GetDrive(type), driveContentsLayout);
-                    drivesGUI[i].OnChanged += x => { joint.SetDrive(type, new D6JointDrive(x)); MarkAsModified(); };
+                    drivesGUI[i].OnChanged += x => { joint.SetDrive(type, x); MarkAsModified(); };
                     drivesGUI[i].OnConfirmed += ConfirmModify;
                     drivesGUI[i].OnConfirmed += ConfirmModify;
                 }
                 }
 
 
@@ -228,14 +231,14 @@ namespace BansheeEditor
     /// </summary>
     /// </summary>
     internal class D6JointDriveGUI
     internal class D6JointDriveGUI
     {
     {
-        private D6JointDriveData driveData;
+        private D6JointDrive driveData;
 
 
         private GUIFloatField stiffnessField = new GUIFloatField(new LocEdString("Stiffness"));
         private GUIFloatField stiffnessField = new GUIFloatField(new LocEdString("Stiffness"));
         private GUIFloatField dampingField = new GUIFloatField(new LocEdString("Damping"));
         private GUIFloatField dampingField = new GUIFloatField(new LocEdString("Damping"));
         private GUIFloatField forceLimitField = new GUIFloatField(new LocEdString("Force limit"));
         private GUIFloatField forceLimitField = new GUIFloatField(new LocEdString("Force limit"));
         private GUIToggleField accelerationField = new GUIToggleField(new LocEdString("Acceleration"));
         private GUIToggleField accelerationField = new GUIToggleField(new LocEdString("Acceleration"));
 
 
-        public Action<D6JointDriveData> OnChanged;
+        public Action<D6JointDrive> OnChanged;
         public Action OnConfirmed;
         public Action OnConfirmed;
 
 
         /// <summary>
         /// <summary>
@@ -245,7 +248,7 @@ namespace BansheeEditor
         {
         {
             set
             set
             {
             {
-                driveData = value.Data;
+                driveData = value;
 
 
                 stiffnessField.Value = driveData.stiffness;
                 stiffnessField.Value = driveData.stiffness;
                 dampingField.Value = driveData.damping;
                 dampingField.Value = driveData.damping;
@@ -261,7 +264,7 @@ namespace BansheeEditor
         /// <param name="layout">Layout to append the GUI elements to.</param>
         /// <param name="layout">Layout to append the GUI elements to.</param>
         public D6JointDriveGUI(D6JointDrive drive, GUILayout layout)
         public D6JointDriveGUI(D6JointDrive drive, GUILayout layout)
         {
         {
-            driveData = drive.Data;
+            driveData = drive;
 
 
             stiffnessField.OnChanged += x => { driveData.stiffness = x; MarkAsModified(); };
             stiffnessField.OnChanged += x => { driveData.stiffness = x; MarkAsModified(); };
             stiffnessField.OnFocusLost += ConfirmModify;
             stiffnessField.OnFocusLost += ConfirmModify;

+ 18 - 15
Source/MBansheeEditor/Inspectors/DistanceJointInspector.cs

@@ -56,7 +56,7 @@ namespace BansheeEditor
         {
         {
             enableMinLimitField.OnChanged += x =>
             enableMinLimitField.OnChanged += x =>
             {
             {
-                joint.EnableMinDistanceLimit = x;
+                joint.SetFlag(DistanceJointFlag.MinDistance, x);
                 MarkAsModified();
                 MarkAsModified();
                 ConfirmModify();
                 ConfirmModify();
 
 
@@ -69,7 +69,7 @@ namespace BansheeEditor
 
 
             enableMaxLimitField.OnChanged += x =>
             enableMaxLimitField.OnChanged += x =>
             {
             {
-                joint.EnableMaxDistanceLimit = x;
+                joint.SetFlag(DistanceJointFlag.MaxDistance, x);
                 MarkAsModified();
                 MarkAsModified();
                 ConfirmModify();
                 ConfirmModify();
 
 
@@ -86,7 +86,7 @@ namespace BansheeEditor
 
 
             enableSpringField.OnChanged += x =>
             enableSpringField.OnChanged += x =>
             {
             {
-                joint.EnableSpring = x;
+                joint.SetFlag(DistanceJointFlag.Spring, x);
                 MarkAsModified();
                 MarkAsModified();
                 ConfirmModify();
                 ConfirmModify();
 
 
@@ -117,9 +117,9 @@ namespace BansheeEditor
                 springGUI.OnConfirmed += ConfirmModify;
                 springGUI.OnConfirmed += ConfirmModify;
             }
             }
 
 
-            minLimitField.Active = joint.EnableMinDistanceLimit;
-            maxLimitField.Active = joint.EnableMaxDistanceLimit;
-            springLayout.Active = joint.EnableSpring;
+            minLimitField.Active = joint.HasFlag(DistanceJointFlag.MinDistance);
+            maxLimitField.Active = joint.HasFlag(DistanceJointFlag.MaxDistance);
+            springLayout.Active = joint.HasFlag(DistanceJointFlag.Spring);
 
 
             base.BuildGUI(joint, true);
             base.BuildGUI(joint, true);
         }
         }
@@ -130,27 +130,30 @@ namespace BansheeEditor
         /// <param name="joint">Joint to update the GUI from.</param>
         /// <param name="joint">Joint to update the GUI from.</param>
         protected void Refresh(DistanceJoint joint)
         protected void Refresh(DistanceJoint joint)
         {
         {
-            if (enableMinLimitField.Value != joint.EnableMinDistanceLimit)
+            bool enableMinDistanceLimit = joint.HasFlag(DistanceJointFlag.MinDistance);
+            if (enableMinLimitField.Value != enableMinDistanceLimit)
             {
             {
-                enableMinLimitField.Value = joint.EnableMinDistanceLimit;
-                minLimitField.Active = joint.EnableMinDistanceLimit;
+                enableMinLimitField.Value = enableMinDistanceLimit;
+                minLimitField.Active = enableMinDistanceLimit;
             }
             }
 
 
             minLimitField.Value = joint.MinDistance;
             minLimitField.Value = joint.MinDistance;
 
 
-            if (enableMaxLimitField.Value != joint.EnableMaxDistanceLimit)
+            bool enableMaxDistanceLimit = joint.HasFlag(DistanceJointFlag.MaxDistance);
+            if (enableMaxLimitField.Value != enableMaxDistanceLimit)
             {
             {
-                enableMaxLimitField.Value = joint.EnableMaxDistanceLimit;
-                maxLimitField.Active = joint.EnableMaxDistanceLimit;
+                enableMaxLimitField.Value = enableMaxDistanceLimit;
+                maxLimitField.Active = enableMaxDistanceLimit;
             }
             }
 
 
             maxLimitField.Value = joint.MaxDistance;
             maxLimitField.Value = joint.MaxDistance;
             toleranceField.Value = joint.Tolerance;
             toleranceField.Value = joint.Tolerance;
 
 
-            if (enableSpringField.Value != joint.EnableSpring)
+            bool enableSpring = joint.HasFlag(DistanceJointFlag.Spring);
+            if (enableSpringField.Value != enableSpring)
             {
             {
-                enableSpringField.Value = joint.EnableSpring;
-                springLayout.Active = joint.EnableSpring;
+                enableSpringField.Value = enableSpring;
+                springLayout.Active = enableSpring;
             }
             }
 
 
             springGUI.Spring = joint.Spring;
             springGUI.Spring = joint.Spring;

+ 26 - 23
Source/MBansheeEditor/Inspectors/HingeJointInspector.cs

@@ -58,7 +58,7 @@ namespace BansheeEditor
         {
         {
             enableLimitField.OnChanged += x =>
             enableLimitField.OnChanged += x =>
             {
             {
-                joint.EnableLimit = x;
+                joint.SetFlag(HingeJointFlag.Limit, x);
                 MarkAsModified();
                 MarkAsModified();
                 ConfirmModify();
                 ConfirmModify();
 
 
@@ -67,7 +67,7 @@ namespace BansheeEditor
             
             
             enableDriveField.OnChanged += x =>
             enableDriveField.OnChanged += x =>
             {
             {
-                joint.EnableDrive = x;
+                joint.SetFlag(HingeJointFlag.Drive, x);
                 MarkAsModified();
                 MarkAsModified();
                 ConfirmModify();
                 ConfirmModify();
 
 
@@ -76,9 +76,9 @@ namespace BansheeEditor
 
 
             speedField.OnChanged += x =>
             speedField.OnChanged += x =>
             {
             {
-                HingeJointDriveData driveData = joint.Drive.Data;
+                HingeJointDrive driveData = joint.Drive;
                 driveData.speed = x;
                 driveData.speed = x;
-                joint.Drive = new HingeJointDrive(driveData);
+                joint.Drive = driveData;
 
 
                 MarkAsModified();
                 MarkAsModified();
             };
             };
@@ -87,9 +87,9 @@ namespace BansheeEditor
 
 
             forceLimitField.OnChanged += x =>
             forceLimitField.OnChanged += x =>
             {
             {
-                HingeJointDriveData driveData = joint.Drive.Data;
+                HingeJointDrive driveData = joint.Drive;
                 driveData.forceLimit = x;
                 driveData.forceLimit = x;
-                joint.Drive = new HingeJointDrive(driveData);
+                joint.Drive = driveData;
 
 
                 MarkAsModified();
                 MarkAsModified();
             };
             };
@@ -98,9 +98,9 @@ namespace BansheeEditor
 
 
             gearRatioField.OnChanged += x =>
             gearRatioField.OnChanged += x =>
             {
             {
-                HingeJointDriveData driveData = joint.Drive.Data;
+                HingeJointDrive driveData = joint.Drive;
                 driveData.gearRatio = x;
                 driveData.gearRatio = x;
-                joint.Drive = new HingeJointDrive(driveData);
+                joint.Drive = driveData;
 
 
                 MarkAsModified();
                 MarkAsModified();
             };
             };
@@ -109,9 +109,9 @@ namespace BansheeEditor
 
 
             freeSpinField.OnChanged += x =>
             freeSpinField.OnChanged += x =>
             {
             {
-                HingeJointDriveData driveData = joint.Drive.Data;
+                HingeJointDrive driveData = joint.Drive;
                 driveData.freeSpin = x;
                 driveData.freeSpin = x;
-                joint.Drive = new HingeJointDrive(driveData);
+                joint.Drive = driveData;
 
 
                 MarkAsModified();
                 MarkAsModified();
                 ConfirmModify();
                 ConfirmModify();
@@ -126,7 +126,8 @@ namespace BansheeEditor
                 limitGUI = new LimitAngularRangeGUI(joint.Limit, limitContentsLayout, Persistent);
                 limitGUI = new LimitAngularRangeGUI(joint.Limit, limitContentsLayout, Persistent);
                 limitGUI.OnChanged += (x, y) =>
                 limitGUI.OnChanged += (x, y) =>
                 {
                 {
-                    joint.Limit = new LimitAngularRange(x, y);
+                    joint.Limit = x;
+                    joint.Limit.SetBase(y);
 
 
                     MarkAsModified();
                     MarkAsModified();
                 };
                 };
@@ -145,8 +146,8 @@ namespace BansheeEditor
                 driveContentsLayout.AddElement(freeSpinField);
                 driveContentsLayout.AddElement(freeSpinField);
             }
             }
 
 
-            ToggleLimitFields(joint.EnableLimit);
-            ToggleDriveFields(joint.EnableDrive);
+            ToggleLimitFields(joint.HasFlag(HingeJointFlag.Limit));
+            ToggleDriveFields(joint.HasFlag(HingeJointFlag.Drive));
 
 
             base.BuildGUI(joint, true);
             base.BuildGUI(joint, true);
         }
         }
@@ -157,24 +158,26 @@ namespace BansheeEditor
         /// <param name="joint">Joint to update the GUI from.</param>
         /// <param name="joint">Joint to update the GUI from.</param>
         protected void Refresh(HingeJoint joint)
         protected void Refresh(HingeJoint joint)
         {
         {
-            if (enableLimitField.Value != joint.EnableLimit)
+            bool enableLimit = joint.HasFlag(HingeJointFlag.Limit);
+            if (enableLimitField.Value != enableLimit)
             {
             {
-                enableLimitField.Value = joint.EnableLimit;
-                ToggleLimitFields(joint.EnableLimit);
+                enableLimitField.Value = enableLimit;
+                ToggleLimitFields(enableLimit);
             }
             }
 
 
             limitGUI.Limit = joint.Limit;
             limitGUI.Limit = joint.Limit;
 
 
-            if (enableDriveField.Value != joint.EnableDrive)
+            bool enableDrive = joint.HasFlag(HingeJointFlag.Drive);
+            if (enableDriveField.Value != enableDrive)
             {
             {
-                enableDriveField.Value = joint.EnableDrive;
-                ToggleDriveFields(joint.EnableDrive);
+                enableDriveField.Value = enableDrive;
+                ToggleDriveFields(enableDrive);
             }
             }
 
 
-            speedField.Value = joint.Drive.Speed;
-            forceLimitField.Value = joint.Drive.ForceLimit;
-            gearRatioField.Value = joint.Drive.GearRatio;
-            freeSpinField.Value = joint.Drive.FreeSpin;
+            speedField.Value = joint.Drive.speed;
+            forceLimitField.Value = joint.Drive.forceLimit;
+            gearRatioField.Value = joint.Drive.gearRatio;
+            freeSpinField.Value = joint.Drive.freeSpin;
 
 
             base.Refresh(joint);
             base.Refresh(joint);
         }
         }

+ 14 - 6
Source/MBansheeEditor/Inspectors/JointInspector.cs

@@ -32,8 +32,8 @@ namespace BansheeEditor
         /// <param name="joint">Joint to update the GUI from.</param>
         /// <param name="joint">Joint to update the GUI from.</param>
         protected virtual void Refresh(Joint joint)
         protected virtual void Refresh(Joint joint)
         {
         {
-            targetField.Value = joint.GetRigidbody(JointBody.Target);
-            anchorField.Value = joint.GetRigidbody(JointBody.Anchor);
+            targetField.Value = joint.GetBody(JointBody.Target);
+            anchorField.Value = joint.GetBody(JointBody.Anchor);
 
 
             if (showOffsets)
             if (showOffsets)
             {
             {
@@ -66,16 +66,24 @@ namespace BansheeEditor
             breakTorqueField = new GUIFloatField(new LocEdString("Break torque"));
             breakTorqueField = new GUIFloatField(new LocEdString("Break torque"));
             collisionField = new GUIToggleField(new LocEdString("Enable collision"));
             collisionField = new GUIToggleField(new LocEdString("Enable collision"));
 
 
-            targetField.OnChanged += x => { joint.SetRigidbody(JointBody.Target, (Rigidbody)x); MarkAsModified(); ConfirmModify(); };
-            anchorField.OnChanged += x => { joint.SetRigidbody(JointBody.Anchor, (Rigidbody)x); MarkAsModified(); ConfirmModify(); };
+            targetField.OnChanged += x => { joint.SetBody(JointBody.Target, (Rigidbody)x); MarkAsModified(); ConfirmModify(); };
+            anchorField.OnChanged += x => { joint.SetBody(JointBody.Anchor, (Rigidbody)x); MarkAsModified(); ConfirmModify(); };
 
 
             if(showOffsets)
             if(showOffsets)
             { 
             { 
-                targetOffsetField.OnChanged += x => { joint.SetPosition(JointBody.Target, x); MarkAsModified(); };
+                targetOffsetField.OnChanged += x =>
+                {
+                    joint.SetTransform(JointBody.Target, x, joint.GetRotation(JointBody.Target));
+                    MarkAsModified();
+                };
                 targetOffsetField.OnFocusLost += ConfirmModify;
                 targetOffsetField.OnFocusLost += ConfirmModify;
                 targetOffsetField.OnConfirmed += ConfirmModify;
                 targetOffsetField.OnConfirmed += ConfirmModify;
 
 
-                anchorOffsetField.OnChanged += x => { joint.SetPosition(JointBody.Anchor, x); MarkAsModified(); };
+                anchorOffsetField.OnChanged += x =>
+                {
+                    joint.SetTransform(JointBody.Anchor, x, joint.GetRotation(JointBody.Anchor));
+                    MarkAsModified();
+                };
                 anchorOffsetField.OnFocusLost += ConfirmModify;
                 anchorOffsetField.OnFocusLost += ConfirmModify;
                 anchorOffsetField.OnConfirmed += ConfirmModify;
                 anchorOffsetField.OnConfirmed += ConfirmModify;
             }
             }

+ 28 - 28
Source/MBansheeEditor/Inspectors/LimitInspectors.cs

@@ -82,7 +82,7 @@ namespace BansheeEditor
     /// </summary>
     /// </summary>
     internal class LimitCommonGUI
     internal class LimitCommonGUI
     {
     {
-        private LimitCommonData limitData;
+        private LimitCommon limitData;
         private SerializableProperties properties;
         private SerializableProperties properties;
         private string prefix;
         private string prefix;
 
 
@@ -97,13 +97,13 @@ namespace BansheeEditor
         private GUILayoutX softLimitLayout;
         private GUILayoutX softLimitLayout;
         private GUILayoutX springLayout;
         private GUILayoutX springLayout;
 
 
-        public Action<LimitCommonData> OnChanged;
+        public Action<LimitCommon> OnChanged;
         public Action OnConfirmed;
         public Action OnConfirmed;
 
 
         /// <summary>
         /// <summary>
         /// Current limit properties.
         /// Current limit properties.
         /// </summary>
         /// </summary>
-        public LimitCommonData LimitData
+        public LimitCommon LimitData
         {
         {
             get { return limitData; }
             get { return limitData; }
             set
             set
@@ -124,7 +124,7 @@ namespace BansheeEditor
         /// <param name="layout">Layout to append the GUI elements to.</param>
         /// <param name="layout">Layout to append the GUI elements to.</param>
         /// <param name="properties">A set of properties that are persisted by the parent inspector. Used for saving state.
         /// <param name="properties">A set of properties that are persisted by the parent inspector. Used for saving state.
         ///                          </param>
         ///                          </param>
-        public LimitCommonGUI(string prefix, LimitCommonData limitData, GUILayout layout, SerializableProperties properties)
+        public LimitCommonGUI(string prefix, LimitCommon limitData, GUILayout layout, SerializableProperties properties)
         {
         {
             this.limitData = limitData;
             this.limitData = limitData;
             this.properties = properties;
             this.properties = properties;
@@ -217,12 +217,12 @@ namespace BansheeEditor
     /// </summary>
     /// </summary>
     internal class LimitLinearGUI
     internal class LimitLinearGUI
     {
     {
-        private LimitLinearData limitData;
+        private LimitLinear limitData;
 
 
         private GUIFloatField limitExtentField = new GUIFloatField(new LocEdString("Extent"));
         private GUIFloatField limitExtentField = new GUIFloatField(new LocEdString("Extent"));
         private LimitCommonGUI limitCommonGUI;
         private LimitCommonGUI limitCommonGUI;
 
 
-        public Action<LimitLinearData, LimitCommonData> OnChanged;
+        public Action<LimitLinear, LimitCommon> OnChanged;
         public Action OnConfirmed;
         public Action OnConfirmed;
 
 
         /// <summary>
         /// <summary>
@@ -232,10 +232,10 @@ namespace BansheeEditor
         {
         {
             set
             set
             {
             {
-                limitData = value.Data;
+                limitData = value;
 
 
                 limitExtentField.Value = limitData.extent;
                 limitExtentField.Value = limitData.extent;
-                limitCommonGUI.LimitData = value.CommonData;
+                limitCommonGUI.LimitData = value.GetBase();
             }
             }
         }
         }
 
 
@@ -248,13 +248,13 @@ namespace BansheeEditor
         ///                          </param>
         ///                          </param>
         public LimitLinearGUI(LimitLinear limit, GUILayout layout, SerializableProperties properties)
         public LimitLinearGUI(LimitLinear limit, GUILayout layout, SerializableProperties properties)
         {
         {
-            limitData = limit.Data;
+            limitData = limit;
 
 
             limitExtentField.OnChanged += x => { limitData.extent = x; MarkAsModified(); };
             limitExtentField.OnChanged += x => { limitData.extent = x; MarkAsModified(); };
             limitExtentField.OnFocusLost += ConfirmModify;
             limitExtentField.OnFocusLost += ConfirmModify;
 
 
             layout.AddElement(limitExtentField);
             layout.AddElement(limitExtentField);
-            limitCommonGUI = new LimitCommonGUI("linear", limit.CommonData, layout, properties);
+            limitCommonGUI = new LimitCommonGUI("linear", limit.GetBase(), layout, properties);
             limitCommonGUI.OnChanged += x => MarkAsModified();
             limitCommonGUI.OnChanged += x => MarkAsModified();
             limitCommonGUI.OnConfirmed += ConfirmModify;
             limitCommonGUI.OnConfirmed += ConfirmModify;
         }
         }
@@ -283,13 +283,13 @@ namespace BansheeEditor
     /// </summary>
     /// </summary>
     internal class LimitLinearRangeGUI
     internal class LimitLinearRangeGUI
     {
     {
-        private LimitLinearRangeData limitData;
+        private LimitLinearRange limitData;
 
 
         private GUIFloatField limitLowerField = new GUIFloatField(new LocEdString("Lower"));
         private GUIFloatField limitLowerField = new GUIFloatField(new LocEdString("Lower"));
         private GUIFloatField limitUpperField = new GUIFloatField(new LocEdString("Upper"));
         private GUIFloatField limitUpperField = new GUIFloatField(new LocEdString("Upper"));
         private LimitCommonGUI limitCommonGUI;
         private LimitCommonGUI limitCommonGUI;
 
 
-        public Action<LimitLinearRangeData, LimitCommonData> OnChanged;
+        public Action<LimitLinearRange, LimitCommon> OnChanged;
         public Action OnConfirmed;
         public Action OnConfirmed;
 
 
         /// <summary>
         /// <summary>
@@ -299,11 +299,11 @@ namespace BansheeEditor
         {
         {
             set
             set
             {
             {
-                limitData = value.Data;
+                limitData = value;
 
 
                 limitLowerField.Value = limitData.lower;
                 limitLowerField.Value = limitData.lower;
                 limitUpperField.Value = limitData.upper;
                 limitUpperField.Value = limitData.upper;
-                limitCommonGUI.LimitData = value.CommonData;
+                limitCommonGUI.LimitData = value.GetBase();
             }
             }
         }
         }
 
 
@@ -316,7 +316,7 @@ namespace BansheeEditor
         ///                          </param>
         ///                          </param>
         public LimitLinearRangeGUI(LimitLinearRange limit, GUILayout layout, SerializableProperties properties)
         public LimitLinearRangeGUI(LimitLinearRange limit, GUILayout layout, SerializableProperties properties)
         {
         {
-            this.limitData = limit.Data;
+            this.limitData = limit;
 
 
             limitLowerField.OnChanged += x => { limitData.lower = x; MarkAsModified(); };
             limitLowerField.OnChanged += x => { limitData.lower = x; MarkAsModified(); };
             limitLowerField.OnFocusLost += ConfirmModify;
             limitLowerField.OnFocusLost += ConfirmModify;
@@ -326,7 +326,7 @@ namespace BansheeEditor
 
 
             layout.AddElement(limitLowerField);
             layout.AddElement(limitLowerField);
             layout.AddElement(limitUpperField);
             layout.AddElement(limitUpperField);
-            limitCommonGUI = new LimitCommonGUI("linearRange", limit.CommonData, layout, properties);
+            limitCommonGUI = new LimitCommonGUI("linearRange", limit.GetBase(), layout, properties);
             limitCommonGUI.OnChanged += x => MarkAsModified();
             limitCommonGUI.OnChanged += x => MarkAsModified();
             limitCommonGUI.OnConfirmed += ConfirmModify;
             limitCommonGUI.OnConfirmed += ConfirmModify;
         }
         }
@@ -355,13 +355,13 @@ namespace BansheeEditor
     /// </summary>
     /// </summary>
     internal class LimitAngularRangeGUI
     internal class LimitAngularRangeGUI
     {
     {
-        private LimitAngularRangeData limitData;
+        private LimitAngularRange limitData;
 
 
         private GUISliderField limitLowerField = new GUISliderField(0, 359, new LocEdString("Lower"));
         private GUISliderField limitLowerField = new GUISliderField(0, 359, new LocEdString("Lower"));
         private GUISliderField limitUpperField = new GUISliderField(0, 359, new LocEdString("Upper"));
         private GUISliderField limitUpperField = new GUISliderField(0, 359, new LocEdString("Upper"));
         private LimitCommonGUI limitCommonGUI;
         private LimitCommonGUI limitCommonGUI;
 
 
-        public Action<LimitAngularRangeData, LimitCommonData> OnChanged;
+        public Action<LimitAngularRange, LimitCommon> OnChanged;
         public Action OnConfirmed;
         public Action OnConfirmed;
 
 
         /// <summary>
         /// <summary>
@@ -371,11 +371,11 @@ namespace BansheeEditor
         {
         {
             set
             set
             {
             {
-                limitData = value.Data;
+                limitData = value;
 
 
                 limitLowerField.Value = limitData.lower.Degrees;
                 limitLowerField.Value = limitData.lower.Degrees;
                 limitUpperField.Value = limitData.upper.Degrees;
                 limitUpperField.Value = limitData.upper.Degrees;
-                limitCommonGUI.LimitData = value.CommonData;
+                limitCommonGUI.LimitData = value.GetBase();
             }
             }
         }
         }
 
 
@@ -388,7 +388,7 @@ namespace BansheeEditor
         ///                          </param>
         ///                          </param>
         public LimitAngularRangeGUI(LimitAngularRange limit, GUILayout layout, SerializableProperties properties)
         public LimitAngularRangeGUI(LimitAngularRange limit, GUILayout layout, SerializableProperties properties)
         {
         {
-            this.limitData = limit.Data;
+            this.limitData = limit;
 
 
             limitLowerField.OnChanged += x => { limitData.lower = new Degree(x); MarkAsModified(); };
             limitLowerField.OnChanged += x => { limitData.lower = new Degree(x); MarkAsModified(); };
             limitLowerField.OnFocusLost += ConfirmModify;
             limitLowerField.OnFocusLost += ConfirmModify;
@@ -398,7 +398,7 @@ namespace BansheeEditor
 
 
             layout.AddElement(limitLowerField);
             layout.AddElement(limitLowerField);
             layout.AddElement(limitUpperField);
             layout.AddElement(limitUpperField);
-            limitCommonGUI = new LimitCommonGUI("angularRange", limit.CommonData, layout, properties);
+            limitCommonGUI = new LimitCommonGUI("angularRange", limit.GetBase(), layout, properties);
             limitCommonGUI.OnChanged += x => MarkAsModified();
             limitCommonGUI.OnChanged += x => MarkAsModified();
             limitCommonGUI.OnConfirmed += ConfirmModify;
             limitCommonGUI.OnConfirmed += ConfirmModify;
         }
         }
@@ -427,13 +427,13 @@ namespace BansheeEditor
     /// </summary>
     /// </summary>
     internal class LimitConeRangeGUI
     internal class LimitConeRangeGUI
     {
     {
-        private LimitConeRangeData limitData;
+        private LimitConeRange limitData;
 
 
         private GUISliderField yLimitAngleField = new GUISliderField(0, 180, new LocEdString("Y limit"));
         private GUISliderField yLimitAngleField = new GUISliderField(0, 180, new LocEdString("Y limit"));
         private GUISliderField zLimitAngleField = new GUISliderField(0, 180, new LocEdString("Z limit"));
         private GUISliderField zLimitAngleField = new GUISliderField(0, 180, new LocEdString("Z limit"));
         private LimitCommonGUI limitCommonGUI;
         private LimitCommonGUI limitCommonGUI;
 
 
-        public Action<LimitConeRangeData, LimitCommonData> OnChanged;
+        public Action<LimitConeRange, LimitCommon> OnChanged;
         public Action OnConfirmed;
         public Action OnConfirmed;
 
 
         /// <summary>
         /// <summary>
@@ -443,11 +443,11 @@ namespace BansheeEditor
         {
         {
             set
             set
             {
             {
-                limitData = value.Data;
+                limitData = value;
 
 
                 yLimitAngleField.Value = limitData.yLimitAngle.Degrees;
                 yLimitAngleField.Value = limitData.yLimitAngle.Degrees;
                 zLimitAngleField.Value = limitData.zLimitAngle.Degrees;
                 zLimitAngleField.Value = limitData.zLimitAngle.Degrees;
-                limitCommonGUI.LimitData = value.CommonData;
+                limitCommonGUI.LimitData = value.GetBase();
             }
             }
         }
         }
 
 
@@ -460,7 +460,7 @@ namespace BansheeEditor
         ///                          </param>
         ///                          </param>
         public LimitConeRangeGUI(LimitConeRange limit, GUILayout layout, SerializableProperties properties)
         public LimitConeRangeGUI(LimitConeRange limit, GUILayout layout, SerializableProperties properties)
         {
         {
-            this.limitData = limit.Data;
+            this.limitData = limit;
 
 
             yLimitAngleField.OnChanged += x => { limitData.yLimitAngle = new Degree(x); MarkAsModified(); };
             yLimitAngleField.OnChanged += x => { limitData.yLimitAngle = new Degree(x); MarkAsModified(); };
             yLimitAngleField.OnFocusLost += ConfirmModify;
             yLimitAngleField.OnFocusLost += ConfirmModify;
@@ -470,7 +470,7 @@ namespace BansheeEditor
 
 
             layout.AddElement(yLimitAngleField);
             layout.AddElement(yLimitAngleField);
             layout.AddElement(zLimitAngleField);
             layout.AddElement(zLimitAngleField);
-            limitCommonGUI = new LimitCommonGUI("coneRange", limit.CommonData, layout, properties);
+            limitCommonGUI = new LimitCommonGUI("coneRange", limit.GetBase(), layout, properties);
             limitCommonGUI.OnChanged += x => MarkAsModified();
             limitCommonGUI.OnChanged += x => MarkAsModified();
             limitCommonGUI.OnConfirmed += ConfirmModify;
             limitCommonGUI.OnConfirmed += ConfirmModify;
         }
         }

+ 2 - 2
Source/MBansheeEditor/Inspectors/RigidbodyInspector.cs

@@ -39,7 +39,7 @@ namespace BansheeEditor
             if (body == null)
             if (body == null)
                 return InspectableState.NotModified;
                 return InspectableState.NotModified;
 
 
-            kinematicField.Value = body.Kinematic;
+            kinematicField.Value = body.IsKinematic;
             applyGravityField.Value = body.UseGravity;
             applyGravityField.Value = body.UseGravity;
             automaticMassField.Value = (body.Flags & RigidbodyFlag.AutoMass) != 0;
             automaticMassField.Value = (body.Flags & RigidbodyFlag.AutoMass) != 0;
             massField.Value = body.Mass;
             massField.Value = body.Mass;
@@ -66,7 +66,7 @@ namespace BansheeEditor
             if (body == null)
             if (body == null)
                 return;
                 return;
 
 
-            kinematicField.OnChanged += x => { body.Kinematic = x; MarkAsModified(); ConfirmModify(); };
+            kinematicField.OnChanged += x => { body.IsKinematic = x; MarkAsModified(); ConfirmModify(); };
             applyGravityField.OnChanged += x => { body.UseGravity = x; MarkAsModified(); ConfirmModify(); };
             applyGravityField.OnChanged += x => { body.UseGravity = x; MarkAsModified(); ConfirmModify(); };
             automaticMassField.OnChanged += x =>
             automaticMassField.OnChanged += x =>
             {
             {

+ 8 - 6
Source/MBansheeEditor/Inspectors/SliderJointInspector.cs

@@ -51,7 +51,7 @@ namespace BansheeEditor
         {
         {
             enableLimitField.OnChanged += x =>
             enableLimitField.OnChanged += x =>
             {
             {
-                joint.EnableLimit = x;
+                joint.SetFlag(SliderJointFlag.Limit, x);
                 MarkAsModified();
                 MarkAsModified();
                 ConfirmModify();
                 ConfirmModify();
 
 
@@ -67,14 +67,15 @@ namespace BansheeEditor
                 limitGUI = new LimitLinearRangeGUI(joint.Limit, limitContentsLayout, Persistent);
                 limitGUI = new LimitLinearRangeGUI(joint.Limit, limitContentsLayout, Persistent);
                 limitGUI.OnChanged += (x, y) =>
                 limitGUI.OnChanged += (x, y) =>
                 {
                 {
-                    joint.Limit = new LimitLinearRange(x, y);
+                    joint.Limit = x;
+                    joint.Limit.SetBase(y);
 
 
                     MarkAsModified();
                     MarkAsModified();
                 };
                 };
                 limitGUI.OnConfirmed += ConfirmModify;
                 limitGUI.OnConfirmed += ConfirmModify;
             }
             }
             
             
-            ToggleLimitFields(joint.EnableLimit);
+            ToggleLimitFields(joint.HasFlag(SliderJointFlag.Limit));
 
 
             base.BuildGUI(joint, true);
             base.BuildGUI(joint, true);
         }
         }
@@ -85,10 +86,11 @@ namespace BansheeEditor
         /// <param name="joint">Joint to update the GUI from.</param>
         /// <param name="joint">Joint to update the GUI from.</param>
         protected void Refresh(SliderJoint joint)
         protected void Refresh(SliderJoint joint)
         {
         {
-            if (enableLimitField.Value != joint.EnableLimit)
+            bool enableLimit = joint.HasFlag(SliderJointFlag.Limit);
+            if (enableLimitField.Value != enableLimit)
             {
             {
-                enableLimitField.Value = joint.EnableLimit;
-                ToggleLimitFields(joint.EnableLimit);
+                enableLimitField.Value = enableLimit;
+                ToggleLimitFields(enableLimit);
             }
             }
 
 
             limitGUI.Limit = joint.Limit;
             limitGUI.Limit = joint.Limit;

+ 8 - 6
Source/MBansheeEditor/Inspectors/SphericalJointInspector.cs

@@ -51,7 +51,7 @@ namespace BansheeEditor
         {
         {
             enableLimitField.OnChanged += x =>
             enableLimitField.OnChanged += x =>
             {
             {
-                joint.EnableLimit = x;
+                joint.SetFlag(SphericalJointFlag.Limit, x);
                 MarkAsModified();
                 MarkAsModified();
                 ConfirmModify();
                 ConfirmModify();
 
 
@@ -67,14 +67,15 @@ namespace BansheeEditor
                 limitGUI = new LimitConeRangeGUI(joint.Limit, limitContentsLayout, Persistent);
                 limitGUI = new LimitConeRangeGUI(joint.Limit, limitContentsLayout, Persistent);
                 limitGUI.OnChanged += (x, y) =>
                 limitGUI.OnChanged += (x, y) =>
                 {
                 {
-                    joint.Limit = new LimitConeRange(x, y);
+                    joint.Limit = x;
+                    joint.Limit.SetBase(y);
 
 
                     MarkAsModified();
                     MarkAsModified();
                 };
                 };
                 limitGUI.OnConfirmed += ConfirmModify;
                 limitGUI.OnConfirmed += ConfirmModify;
             }
             }
 
 
-            ToggleLimitFields(joint.EnableLimit);
+            ToggleLimitFields(joint.HasFlag(SphericalJointFlag.Limit));
 
 
             base.BuildGUI(joint, true);
             base.BuildGUI(joint, true);
         }
         }
@@ -85,10 +86,11 @@ namespace BansheeEditor
         /// <param name="joint">Joint to update the GUI from.</param>
         /// <param name="joint">Joint to update the GUI from.</param>
         protected void Refresh(SphericalJoint joint)
         protected void Refresh(SphericalJoint joint)
         {
         {
-            if (enableLimitField.Value != joint.EnableLimit)
+            bool enableLimit = joint.HasFlag(SphericalJointFlag.Limit);
+            if (enableLimitField.Value != enableLimit)
             {
             {
-                enableLimitField.Value = joint.EnableLimit;
-                ToggleLimitFields(joint.EnableLimit);
+                enableLimitField.Value = enableLimit;
+                ToggleLimitFields(enableLimit);
             }
             }
 
 
             limitGUI.Limit = joint.Limit;
             limitGUI.Limit = joint.Limit;

+ 2 - 2
Source/MBansheeEditor/Windows/Animation/EditorAnimInfo.cs

@@ -78,7 +78,7 @@ namespace BansheeEditor
             EditorAnimClipInfo clipInfo = new EditorAnimClipInfo();
             EditorAnimClipInfo clipInfo = new EditorAnimClipInfo();
             clipInfo.clip = clip;
             clipInfo.clip = clip;
             clipInfo.isImported = IsClipImported(clip);
             clipInfo.isImported = IsClipImported(clip);
-            clipInfo.sampleRate = clip.SampleRate;
+            clipInfo.sampleRate = (int)clip.SampleRate;
 
 
             AnimationCurves clipCurves = clip.Curves;
             AnimationCurves clipCurves = clip.Curves;
             EditorAnimClipTangents editorCurveData = null;
             EditorAnimClipTangents editorCurveData = null;
@@ -493,7 +493,7 @@ namespace BansheeEditor
 
 
             clip.Curves = newClipCurves;
             clip.Curves = newClipCurves;
             clip.Events = events;
             clip.Events = events;
-            clip.SampleRate = sampleRate;
+            clip.SampleRate = (uint)sampleRate;
 
 
             tangents = new EditorAnimClipTangents();
             tangents = new EditorAnimClipTangents();
             tangents.positionCurves = positionTangents.ToArray();
             tangents.positionCurves = positionTangents.ToArray();

+ 3 - 3
Source/MBansheeEditor/Windows/ColorPicker.cs

@@ -933,7 +933,7 @@ namespace BansheeEditor
                 this.guiTexture = guiTexture;
                 this.guiTexture = guiTexture;
                 this.guiSlider = guiSlider;
                 this.guiSlider = guiSlider;
 
 
-                texture = Texture.Create2D(width, height);
+                texture = Texture.Create2D((uint)width, (uint)height);
                 spriteTexture = new SpriteTexture(texture);
                 spriteTexture = new SpriteTexture(texture);
             }
             }
 
 
@@ -997,7 +997,7 @@ namespace BansheeEditor
                 this.guiTexture = guiTexture;
                 this.guiTexture = guiTexture;
                 this.guiSlider = guiSlider;
                 this.guiSlider = guiSlider;
 
 
-                texture = Texture.Create2D(width, height);
+                texture = Texture.Create2D((uint)width, (uint)height);
                 spriteTexture = new SpriteTexture(texture);
                 spriteTexture = new SpriteTexture(texture);
             }
             }
 
 
@@ -1065,7 +1065,7 @@ namespace BansheeEditor
                 this.guiTexture = guiTexture;
                 this.guiTexture = guiTexture;
                 this.guiSliderHandle = guiSliderHandle;
                 this.guiSliderHandle = guiSliderHandle;
 
 
-                texture = Texture.Create2D(width, height);
+                texture = Texture.Create2D((uint)width, (uint)height);
                 spriteTexture = new SpriteTexture(texture);
                 spriteTexture = new SpriteTexture(texture);
             }
             }
 
 

+ 16 - 16
Source/MBansheeEditor/Windows/Scene/Gizmos/JointGizmos.cs

@@ -23,7 +23,7 @@ namespace BansheeEditor
         /// <returns>Anchor position in world space.</returns>
         /// <returns>Anchor position in world space.</returns>
         private static Vector3 GetAnchor(Joint joint, JointBody body)
         private static Vector3 GetAnchor(Joint joint, JointBody body)
         {
         {
-            Rigidbody rigidbody = joint.GetRigidbody(body);
+            Rigidbody rigidbody = joint.GetBody(body);
             Vector3 anchor = joint.GetPosition(body);
             Vector3 anchor = joint.GetPosition(body);
 
 
             if (rigidbody != null)
             if (rigidbody != null)
@@ -81,19 +81,19 @@ namespace BansheeEditor
             float min = 0.0f;
             float min = 0.0f;
             float max = length;
             float max = length;
 
 
-            if (joint.EnableMinDistanceLimit)
+            if (joint.HasFlag(DistanceJointFlag.MinDistance))
             {
             {
                 min = MathEx.Max(0.0f, joint.MinDistance);
                 min = MathEx.Max(0.0f, joint.MinDistance);
-                if (joint.EnableMaxDistanceLimit)
+                if (joint.HasFlag(DistanceJointFlag.MaxDistance))
                     min = MathEx.Min(min, MathEx.Min(10000.0f, joint.MaxDistance));
                     min = MathEx.Min(min, MathEx.Min(10000.0f, joint.MaxDistance));
 
 
                 Gizmos.DrawLine(anchorA, anchorA + normal * min);
                 Gizmos.DrawLine(anchorA, anchorA + normal * min);
             }
             }
 
 
-            if (joint.EnableMaxDistanceLimit)
+            if (joint.HasFlag(DistanceJointFlag.MaxDistance))
             {
             {
                 max = MathEx.Min(10000.0f, joint.MaxDistance);
                 max = MathEx.Min(10000.0f, joint.MaxDistance);
-                if (joint.EnableMinDistanceLimit)
+                if (joint.HasFlag(DistanceJointFlag.MinDistance))
                     max = MathEx.Max(max, min);
                     max = MathEx.Max(max, min);
 
 
                 if (length > max)
                 if (length > max)
@@ -115,12 +115,12 @@ namespace BansheeEditor
             Vector3 target = GetAnchor(joint, JointBody.Target);
             Vector3 target = GetAnchor(joint, JointBody.Target);
             Vector3 normal = -joint.SceneObject.Right;
             Vector3 normal = -joint.SceneObject.Right;
 
 
-            if (joint.EnableLimit)
+            if (joint.HasFlag(SliderJointFlag.Limit))
             {
             {
                 LimitLinearRange limit = joint.Limit;
                 LimitLinearRange limit = joint.Limit;
 
 
-                float max = MathEx.Min(10000.0f, limit.Upper);
-                float min = MathEx.Clamp(limit.Lower, 0.0f, max);
+                float max = MathEx.Min(10000.0f, limit.upper);
+                float min = MathEx.Clamp(limit.lower, 0.0f, max);
                 max = MathEx.Max(max, min);
                 max = MathEx.Max(max, min);
 
 
                 Gizmos.Color = Color.Red;
                 Gizmos.Color = Color.Red;
@@ -152,7 +152,7 @@ namespace BansheeEditor
             Vector3 anchor = GetAnchor(joint, JointBody.Anchor);
             Vector3 anchor = GetAnchor(joint, JointBody.Anchor);
             Vector3 center = target;
             Vector3 center = target;
 
 
-            Rigidbody rigidbody = joint.GetRigidbody(JointBody.Target);
+            Rigidbody rigidbody = joint.GetBody(JointBody.Target);
             if (rigidbody != null)
             if (rigidbody != null)
                 center = rigidbody.SceneObject.Position;
                 center = rigidbody.SceneObject.Position;
 
 
@@ -167,12 +167,12 @@ namespace BansheeEditor
             Gizmos.DrawLine(target, center);
             Gizmos.DrawLine(target, center);
 
 
             Gizmos.Color = Color.Green;
             Gizmos.Color = Color.Green;
-            if (joint.EnableLimit)
+            if (joint.HasFlag(SphericalJointFlag.Limit))
             {
             {
                 LimitConeRange limit = joint.Limit;
                 LimitConeRange limit = joint.Limit;
 
 
-                Radian zAngle = MathEx.Min(new Degree(360), limit.ZLimitAngle * 2.0f);
-                Radian yAngle = MathEx.Min(new Degree(360), limit.YLimitAngle * 2.0f);
+                Radian zAngle = MathEx.Min(new Degree(360), limit.zLimitAngle * 2.0f);
+                Radian yAngle = MathEx.Min(new Degree(360), limit.yLimitAngle * 2.0f);
 
 
                 Gizmos.Transform = joint.SceneObject.WorldTransform;
                 Gizmos.Transform = joint.SceneObject.WorldTransform;
                 Gizmos.DrawWireArc(Vector3.Zero, Vector3.ZAxis, 0.25f, zAngle * -0.5f + new Degree(90), zAngle);
                 Gizmos.DrawWireArc(Vector3.Zero, Vector3.ZAxis, 0.25f, zAngle * -0.5f + new Degree(90), zAngle);
@@ -206,7 +206,7 @@ namespace BansheeEditor
             Vector3 anchor = GetAnchor(joint, JointBody.Anchor);
             Vector3 anchor = GetAnchor(joint, JointBody.Anchor);
             Vector3 center = target;
             Vector3 center = target;
 
 
-            Rigidbody rigidbody = joint.GetRigidbody(JointBody.Target);
+            Rigidbody rigidbody = joint.GetBody(JointBody.Target);
             if (rigidbody != null)
             if (rigidbody != null)
                 center = rigidbody.SceneObject.Position;
                 center = rigidbody.SceneObject.Position;
 
 
@@ -223,7 +223,7 @@ namespace BansheeEditor
             const float radius = 0.25f;
             const float radius = 0.25f;
             const float height = 0.5f;
             const float height = 0.5f;
 
 
-            if (joint.EnableLimit)
+            if (joint.HasFlag(HingeJointFlag.Limit))
             {
             {
                 Gizmos.Transform = joint.SceneObject.WorldTransform;
                 Gizmos.Transform = joint.SceneObject.WorldTransform;
 
 
@@ -231,8 +231,8 @@ namespace BansheeEditor
 
 
                 Action<float> drawLimitedArc = x =>
                 Action<float> drawLimitedArc = x =>
                 {
                 {
-                    Degree lower = MathEx.WrapAngle(limit.Lower);
-                    Degree upper = MathEx.WrapAngle(limit.Upper);
+                    Degree lower = MathEx.WrapAngle(limit.lower);
+                    Degree upper = MathEx.WrapAngle(limit.upper);
 
 
                     lower = MathEx.Min(lower, upper);
                     lower = MathEx.Min(lower, upper);
                     upper = MathEx.Max(upper, lower);
                     upper = MathEx.Max(upper, lower);

+ 2 - 2
Source/MBansheeEditor/Windows/Scene/SceneWindow.cs

@@ -854,8 +854,8 @@ namespace BansheeEditor
             height = MathEx.Max(20, height);
             height = MathEx.Max(20, height);
 
 
             // Note: Depth buffer and readable flags are required because ScenePicking uses it
             // Note: Depth buffer and readable flags are required because ScenePicking uses it
-            Texture colorTex = Texture.Create2D(width, height, PixelFormat.RGBA8, TextureUsage.Render | TextureUsage.CPUReadable);
-            Texture depthTex = Texture.Create2D(width, height, PixelFormat.D32_S8X24, TextureUsage.DepthStencil | TextureUsage.CPUReadable);
+            Texture colorTex = Texture.Create2D((uint)width, (uint)height, PixelFormat.RGBA8, TextureUsage.Render | TextureUsage.CPUReadable);
+            Texture depthTex = Texture.Create2D((uint)width, (uint)height, PixelFormat.D32_S8X24, TextureUsage.DepthStencil | TextureUsage.CPUReadable);
 
 
             renderTexture = new RenderTexture2D(colorTex, depthTex);
             renderTexture = new RenderTexture2D(colorTex, depthTex);
             renderTexture.Priority = 1;
             renderTexture.Priority = 1;

+ 0 - 32
Source/MBansheeEngine/MBansheeEngine.csproj

@@ -119,38 +119,6 @@
     <Compile Include="Rendering\Mesh.cs" />
     <Compile Include="Rendering\Mesh.cs" />
     <Compile Include="Scene\MissingComponent.cs" />
     <Compile Include="Scene\MissingComponent.cs" />
     <Compile Include="Utility\PathEx.cs" />
     <Compile Include="Utility\PathEx.cs" />
-    <Compile Include="Physics\BoxCollider.cs" />
-    <Compile Include="Physics\CapsuleCollider.cs" />
-    <Compile Include="Physics\CharacterController.cs" />
-    <Compile Include="Physics\Collider.cs" />
-    <Compile Include="Physics\D6Joint.cs" />
-    <Compile Include="Physics\DistanceJoint.cs" />
-    <Compile Include="Physics\FixedJoint.cs" />
-    <Compile Include="Physics\HingeJoint.cs" />
-    <Compile Include="Physics\Joint.cs" />
-    <Compile Include="Physics\MeshCollider.cs" />
-    <Compile Include="Physics\Interop\NativeBoxCollider.cs" />
-    <Compile Include="Physics\Interop\NativeCapsuleCollider.cs" />
-    <Compile Include="Physics\Interop\NativeCharacterController.cs" />
-    <Compile Include="Physics\Interop\NativeCollider.cs" />
-    <Compile Include="Physics\Interop\NativeD6Joint.cs" />
-    <Compile Include="Physics\Interop\NativeDistanceJoint.cs" />
-    <Compile Include="Physics\Interop\NativeFixedJoint.cs" />
-    <Compile Include="Physics\Interop\NativeHingeJoint.cs" />
-    <Compile Include="Physics\Interop\NativeJoint.cs" />
-    <Compile Include="Physics\Interop\NativeMeshCollider.cs" />
-    <Compile Include="Physics\Interop\NativePlaneCollider.cs" />
-    <Compile Include="Physics\Interop\NativeRigidbody.cs" />
-    <Compile Include="Physics\Interop\NativeSliderJoint.cs" />
-    <Compile Include="Physics\Interop\NativeSphereCollider.cs" />
-    <Compile Include="Physics\Interop\NativeSphericalJoint.cs" />
-    <Compile Include="Physics\Physics.cs" />
-    <Compile Include="Physics\PhysicsCommon.cs" />
-    <Compile Include="Physics\PlaneCollider.cs" />
-    <Compile Include="Physics\Rigidbody.cs" />
-    <Compile Include="Physics\SliderJoint.cs" />
-    <Compile Include="Physics\SphereCollider.cs" />
-    <Compile Include="Physics\SphericalJoint.cs" />
     <Compile Include="Utility\PixelUtility.cs" />
     <Compile Include="Utility\PixelUtility.cs" />
     <Compile Include="Utility\PlainText.cs" />
     <Compile Include="Utility\PlainText.cs" />
     <Compile Include="Scene\Prefab.cs" />
     <Compile Include="Scene\Prefab.cs" />

+ 0 - 79
Source/MBansheeEngine/Physics/BoxCollider.cs

@@ -1,79 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-namespace BansheeEngine
-{
-    /** @addtogroup Physics
-     *  @{
-     */
-
-    /// <summary>
-    /// Collider with box geometry.
-    /// </summary>
-    public sealed class BoxCollider : Collider
-    {
-        [SerializeField]
-        private Vector3 extents = new Vector3(0.5f, 0.5f, 0.5f);
-
-        /// <summary>
-        /// Extents (half size) of the geometry of the box.
-        /// </summary>
-        public Vector3 Extents
-        {
-            get { return extents; }
-            set
-            {
-                value = new Vector3(MathEx.Max(value.x, 0.01f), MathEx.Max(value.y, 0.01f), MathEx.Max(value.z, 0.01f));
-
-                if (extents == value)
-                    return;
-
-                extents = value;
-
-                if (Native != null)
-                {
-                    Native.Extents = value;
-
-                    if (parent != null)
-                        parent.UpdateMassDistribution();
-                }
-            }
-        }
-
-        /// <summary>
-        /// Position of the box shape, relative to the component's scene object.
-        /// </summary>
-        public Vector3 Center
-        {
-            get { return serializableData.localPosition; }
-            set
-            {
-                if (serializableData.localPosition == value)
-                    return;
-
-                serializableData.localPosition = value;
-
-                if (Native != null)
-                    UpdateTransform();
-            }
-        }
-
-        /// <summary>
-        /// Returns the native box collider wrapped by this component.
-        /// </summary>
-        private NativeBoxCollider Native
-        {
-            get { return (NativeBoxCollider)native; }
-        }
-
-        /// <inheritdoc/>
-        internal override NativeCollider CreateCollider()
-        {
-            NativeBoxCollider boxCollider = new NativeBoxCollider();
-            boxCollider.Extents = extents;
-
-            return boxCollider;
-        }
-    }
-
-    /** @} */
-}

+ 0 - 133
Source/MBansheeEngine/Physics/CapsuleCollider.cs

@@ -1,133 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-namespace BansheeEngine
-{
-    /** @addtogroup Physics
-     *  @{
-     */
-
-    /// <summary>
-    /// Collider with capsule geometry.
-    /// </summary>
-    public sealed class CapsuleCollider : Collider
-    {
-        [SerializeField]
-        private float radius = 0.2f;
-
-        [SerializeField]
-        private float halfHeight = 1.0f;
-
-        [SerializeField]
-        private Vector3 normal = Vector3.YAxis;
-
-        /// <summary>
-        /// Radius of the capsule.
-        /// </summary>
-        public float Radius
-        {
-            get { return radius; }
-            set
-            {
-                value = MathEx.Max(value, 0.01f);
-                if (radius == value)
-                    return;
-
-                radius = value;
-
-                if (Native != null)
-                {
-                    Native.Radius = value;
-
-                    if (parent != null)
-                        parent.UpdateMassDistribution();
-                }
-            }
-        }
-
-        /// <summary>
-        /// Half height of the capsule, from the origin to one of the hemispherical centers, along the normal vector.
-        /// </summary>
-        public float HalfHeight
-        {
-            get { return halfHeight; }
-            set
-            {
-                value = MathEx.Max(value, 0.01f);
-                if (halfHeight == value)
-                    return;
-
-                halfHeight = value;
-
-                if (Native != null)
-                {
-                    Native.HalfHeight = value;
-
-                    if (parent != null)
-                        parent.UpdateMassDistribution();
-                }
-            }
-        }
-        
-        /// <summary>
-        /// Position of the capsule shape, relative to the component's scene object.
-        /// </summary>
-        public Vector3 Center
-        {
-            get { return serializableData.localPosition; }
-            set
-            {
-                if (serializableData.localPosition == value)
-                    return;
-
-                serializableData.localPosition = value;
-
-                if (Native != null)
-                    UpdateTransform();
-            }
-        }
-
-        /// <summary>
-        /// Normal vector of the capsule. It determines how is the capsule oriented.
-        /// </summary>
-        public Vector3 Normal
-        {
-            get { return normal; }
-            set
-            {
-                if (normal == value)
-                    return;
-
-                normal = value.Normalized;
-                serializableData.localRotation = Quaternion.FromToRotation(Vector3.XAxis, normal);
-
-                if (Native != null)
-                    UpdateTransform();
-            }
-        }
-
-        public CapsuleCollider()
-        {
-            serializableData.localRotation = Quaternion.FromToRotation(Vector3.XAxis, normal);
-        }
-
-        /// <summary>
-        /// Returns the native capsule collider wrapped by this component.
-        /// </summary>
-        private NativeCapsuleCollider Native
-        {
-            get { return (NativeCapsuleCollider)native; }
-        }
-
-        /// <inheritdoc/>
-        internal override NativeCollider CreateCollider()
-        {
-            NativeCapsuleCollider capsuleCollider = new NativeCapsuleCollider();
-            capsuleCollider.Radius = radius;
-            capsuleCollider.HalfHeight = halfHeight;
-
-            return capsuleCollider;
-        }
-    }
-
-    /** @} */
-}

+ 0 - 493
Source/MBansheeEngine/Physics/CharacterController.cs

@@ -1,493 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.InteropServices;
-
-namespace BansheeEngine
-{
-    /** @addtogroup Physics
-     *  @{
-     */
-
-    /// <summary>
-    /// Special physics controller meant to be used for game characters. Uses the "slide-and-collide" physics instead of
-    /// of the standard physics model to handle various issues with manually moving kinematic objects.Uses a capsule to
-    /// represent the character's bounds. 
-    /// </summary>
-    public sealed class CharacterController : ManagedComponent
-    {
-        internal NativeCharacterController native;
-
-        [SerializeField]
-        internal SerializableData serializableData = new SerializableData();
-
-        /// <summary>
-        /// Triggered when the controller hits a collider.
-        /// </summary>
-        public event Action<ControllerColliderCollision> OnColliderHit;
-
-        /// <summary>
-        /// Triggered when the controller hits another character controller.
-        /// </summary>
-        public event Action<ControllerControllerCollision> OnControllerHit;
-
-        /// <summary>
-        /// Position of the bottom of the controller. Position takes contact offset into account. Changing this value will 
-        /// teleport the character to the location. Use <see cref="Move"/> for movement that includes physics.
-        /// </summary>
-        public Vector3 FootPosition
-        {
-            get
-            {
-                if (native != null)
-                    return native.FootPosition;
-
-                return Vector3.Zero;
-            }
-            set
-            {
-                if (native != null)
-                {
-                    native.FootPosition = value;
-                    UpdatePositionFromController();
-                }
-            }
-        }
-
-        /// <summary>
-        /// Radius of the controller capsule.
-        /// </summary>
-        public float Radius
-        {
-            get { return serializableData.radius; }
-            set
-            {
-                serializableData.radius = value;
-
-                if(native != null)
-                    UpdateDimensions();
-            }
-        }
-
-        /// <summary>
-        /// Height between the centers of the two spheres of the controller capsule.
-        /// </summary>
-        public float Height
-        {
-            get { return serializableData.height; }
-            set
-            {
-                serializableData.height = value;
-
-                if(native != null)
-                    UpdateDimensions();
-            }
-        }
-
-        /// <summary>
-        /// Up direction of capsule. Determines capsule orientation.
-        /// </summary>
-        public Vector3 Up
-        {
-            get { return serializableData.up; }
-            set
-            {
-                serializableData.up = value;
-
-                if (native != null)
-                    native.Up = value;
-            }
-        }
-
-        /// <summary>
-        /// Controls what happens when character encounters a height higher than its step offset. 
-        /// </summary>
-        public CharacterClimbingMode ClimbingMode
-        {
-            get { return serializableData.climbingMode; }
-            set
-            {
-                serializableData.climbingMode = value;
-
-                if (native != null)
-                    native.ClimbingMode = value;
-            }
-        }
-
-        /// <summary>
-        /// Controls what happens when character encounters a slope higher than its slope offset. 
-        /// </summary>
-        public CharacterNonWalkableMode NonWalkableMode
-        {
-            get { return serializableData.nonWalkableMode; }
-            set
-            {
-                serializableData.nonWalkableMode = value;
-
-                if (native != null)
-                    native.NonWalkableMode = value;
-            }
-        }
-
-        /// <summary>
-        /// Represents minimum distance that the character will move during a call to <see cref="Move"/>. This is used to
-        /// stop the recursive motion algorithm when the remaining distance is too small.
-        /// </summary>
-        public float MinMoveDistance
-        {
-            get { return serializableData.minMoveDistance; }
-            set
-            {
-                serializableData.minMoveDistance = value;
-
-                if (native != null)
-                    native.MinMoveDistance = value;
-            }
-        }
-
-        /// <summary>
-        /// Contact offset specifies a skin around the object within which contacts will be generated. It should be a small
-        /// positive non-zero value.
-        /// </summary>
-        public float ContactOffset
-        {
-            get { return serializableData.contactOffset; }
-            set
-            {
-                serializableData.contactOffset = value;
-
-                if (native != null)
-                    native.ContactOffset = value;
-            }
-        }
-
-        /// <summary>
-        /// Controls which obstacles will the character be able to automatically step over without being stopped. This is 
-        /// the height of the maximum obstacle that will be stepped over (with exceptions, <see cref="ClimbingMode"/>).
-        /// </summary>
-        public float StepOffset
-        {
-            get { return serializableData.stepOffset; }
-            set
-            {
-                serializableData.stepOffset = value;
-
-                if (native != null)
-                    native.StepOffset = value;
-            }
-        }
-
-        /// <summary>
-        /// Controls which slopes should the character consider too steep and won't be able to move over. 
-        /// <see cref="NonWalkableMode"/> for more information.
-        /// </summary>
-        public Radian SlopeLimit
-        {
-            get { return serializableData.slopeLimit; }
-            set
-            {
-                serializableData.slopeLimit = value;
-
-                if (native != null)
-                    native.SlopeLimit = value;
-            }
-        }
-
-        /// <summary>
-        /// Determines what can the controller collide with. Objects that are allowed to collide with this object must have
-        /// the same bits set in their own layers.
-        /// </summary>
-        public ulong Layer
-        {
-            get { return serializableData.layer; }
-            set
-            {
-                serializableData.layer = value;
-
-                if (native != null)
-                    native.Layer = value;
-            }
-        }
-
-        /// <summary>
-        /// Moves the controller in the specified direction by the specified amount, while interacting with surrounding
-        /// geometry.Returns flags signaling where collision occurred after the movement.
-        /// 
-        /// Does not account for gravity, you must apply it manually.
-        /// </summary>
-        /// <param name="position">Position to move the controller to, in world space.</param>
-        public CharacterCollisionFlag Move(Vector3 position)
-        {
-            if (native == null)
-                return 0;
-
-            CharacterCollisionFlag output = native.Move(position);
-            UpdatePositionFromController();
-
-            return output;
-        }
-
-        /// <summary>
-        /// Triggered when the controller hits a collider.
-        /// </summary>
-        /// <param name="data">Data about the collision.</param>
-        internal void DoOnColliderHit(ControllerColliderCollision data)
-        {
-            if (OnColliderHit != null)
-                OnColliderHit(data);
-        }
-
-        /// <summary>
-        /// Triggered when the controller hits another character controller.
-        /// </summary>
-        /// <param name="data">Data about the collision.</param>
-        internal void DoOnControllerHit(ControllerControllerCollision data)
-        {
-            if (OnControllerHit != null)
-                OnControllerHit(data);
-        }
-
-        private void OnInitialize()
-        {
-            NotifyFlags = TransformChangedFlags.Transform;
-        }
-
-        private void OnEnable()
-        {
-            RestoreNative();
-        }
-
-        private void OnDisable()
-        {
-            DestroyNative();
-        }
-
-        private void OnDestroy()
-        {
-            DestroyNative();
-        }
-
-        private void OnTransformChanged(TransformChangedFlags flags)
-        {
-            if (!SceneObject.Active || native == null)
-                return;
-
-            native.Position = SceneObject.Position;
-        }
-
-        /// <summary>
-        /// Updates the position by copying it from the controller to the component's scene object.
-        /// </summary>
-        private void UpdatePositionFromController()
-        {
-            NotifyFlags = 0;
-            SceneObject.Position = native.Position;
-            NotifyFlags = TransformChangedFlags.Transform;
-        }
-
-        /// <summary>
-        /// Updates the dimensions of the controller by taking account scale of the parent scene object.
-        /// </summary>
-        private void UpdateDimensions()
-        {
-            Vector3 scale = SceneObject.Scale;
-            float height = serializableData.height * MathEx.Abs(scale.y);
-            float radius = serializableData.radius * MathEx.Abs(MathEx.Max(scale.x, scale.z));
-
-            native.Height = height;
-            native.Radius = radius;
-        }
-
-        /// <summary>
-        /// Restores the internal character controller representation and initializes it with data stored by the component.
-        /// </summary>
-        private void RestoreNative()
-        {
-            ScriptCharacterControllerData initData = new ScriptCharacterControllerData();
-            initData.position = SceneObject.Position;
-            initData.contactOffset = serializableData.contactOffset;
-            initData.stepOffset = serializableData.stepOffset;
-            initData.slopeLimit = serializableData.slopeLimit;
-            initData.minMoveDistance = serializableData.minMoveDistance;
-            initData.height = serializableData.height;
-            initData.radius = serializableData.radius;
-            initData.up = serializableData.up;
-            initData.climbingMode = serializableData.climbingMode;
-            initData.nonWalkableMode = serializableData.nonWalkableMode;
-
-            native = new NativeCharacterController(initData);
-            native.Component = this;
-            native.Layer = serializableData.layer;
-
-            UpdateDimensions();
-        }
-
-        /// <summary>
-        /// Destroys the internal character controller representation.
-        /// </summary>
-        private void DestroyNative()
-        {
-            if (native != null)
-            {
-                native.Destroy();
-                native = null;
-            }
-        }
-
-        /// <summary>
-        /// Holds all data the character controller component needs to persist through serialization.
-        /// </summary>
-        [SerializeObject]
-        internal class SerializableData
-        {
-            public float contactOffset = 0.1f;
-            public float stepOffset = 0.5f;
-            public Radian slopeLimit = new Degree(45.0f);
-            public float minMoveDistance = 0.0f;
-            public float height = 1.0f;
-            public float radius = 0.25f;
-            public Vector3 up = Vector3.YAxis;
-            public CharacterClimbingMode climbingMode = CharacterClimbingMode.Normal;
-            public CharacterNonWalkableMode nonWalkableMode = CharacterNonWalkableMode.Prevent;
-            public ulong layer = 1;
-        }
-    }
-
-    /// <summary>
-    /// Controls climbing behaviour for a capsule character controller. Normally the character controller will not
-    /// automatically climb when heights are greater than the assigned step offset.However due to the shape of the capsule
-    /// it might automatically climb over slightly larger heights than assigned step offsets.
-    /// </summary>
-    public enum CharacterClimbingMode
-    {
-        /// <summary>
-        /// Normal behaviour. Capsule character controller will be able to auto-step even above the step offset.
-        /// </summary>
-        Normal,
-        /// <summary>
-        /// The system will attempt to limit auto-step to the provided step offset and no higher.
-        /// </summary>
-		Constrained
-    }
-
-    /// <summary>
-    /// Controls behaviour when a character controller reaches a slope thats larger than its slope offset.
-    /// </summary>
-    public enum CharacterNonWalkableMode
-    {
-        /// <summary>
-        /// Character will be prevented from going further, but will be allowed to move laterally.
-        /// </summary>
-        Prevent,
-        /// <summary>
-        /// Character will be prevented from going further, but also slide down the slope.
-        /// </summary>
-		PreventAndSlide
-    }
-
-    /// <summary>
-    /// Reports in which directions is the character colliding with other objects.
-    /// </summary>
-    public enum CharacterCollisionFlag
-    {
-        /// <summary>
-        /// Character is colliding with its sides. 
-        /// </summary>
-        Sides = 0x1,
-        /// <summary>
-        /// Character is colliding with the ceiling.
-        /// </summary>
-		Up = 0x2,
-        /// <summary>
-        /// Character is colliding with the ground.
-        /// </summary>
-		Down = 0x4
-	}
-
-    /// <summary>
-    /// Used for passing CharacterController initialization data between native and managed code.
-    /// </summary>
-    [StructLayout(LayoutKind.Sequential)]
-    internal struct ScriptCharacterControllerData // Note: Must match C++ struct CHAR_CONTROLLER_DESC
-    {
-        public Vector3 position;
-        public float contactOffset;
-        public float stepOffset;
-        public Radian slopeLimit;
-        public float minMoveDistance;
-        public float height;
-        public float radius;
-        public Vector3 up;
-        public CharacterClimbingMode climbingMode;
-        public CharacterNonWalkableMode nonWalkableMode;
-    }
-
-    /// <summary>
-    /// Used for passing ControllerCollision data between native and managed code.
-    /// </summary>
-    internal struct ScriptControllerCollision // Note: Must match C++ struct ScriptControllerCollision
-    {
-        public Vector3 position;
-        public Vector3 normal;
-        public Vector3 motionDir;
-        public float motionAmount;
-        public NativeCollider collider;
-        public int triangleIndex;
-        public NativeCharacterController controller;
-    }
-
-    /// <summary>
-    /// Contains data about a collision of a character controller and another object.
-    /// </summary>
-    public class ControllerCollision
-    {
-        /// <summary>
-        /// Contact position.
-        /// </summary>
-        public Vector3 position;
-
-        /// <summary>
-        /// Contact normal.
-        /// </summary>
-        public Vector3 normal;
-
-        /// <summary>
-        /// Direction of motion after the hit.
-        /// </summary>
-        public Vector3 motionDir;
-
-        /// <summary>
-        /// Magnitude of motion after the hit.
-        /// </summary>
-        public float motionAmount;
-    };
-
-    /// <summary>
-    /// Contains data about a collision of a character controller and a collider.
-    /// </summary>
-    public class ControllerColliderCollision : ControllerCollision
-    {
-        /// <summary>
-        /// Collider that was touched. 
-        /// </summary>
-        public Collider collider;
-
-        /// <summary>
-        /// Touched triangle index for mesh colliders.
-        /// </summary>
-        public int triangleIndex;
-    };
-
-    /// <summary>
-    /// Contains data about a collision between two character controllers.
-    /// </summary>
-    public class ControllerControllerCollision : ControllerCollision
-    {
-        /// <summary>
-        /// Controller that was touched.
-        /// </summary>
-        public CharacterController controller;
-    };
-
-    /** @} */
-}

+ 0 - 485
Source/MBansheeEngine/Physics/Collider.cs

@@ -1,485 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-
-namespace BansheeEngine
-{
-    /** @addtogroup Physics
-     *  @{
-     */
-
-    /// <summary>
-    /// Collider represents physics geometry that can be in multiple states:
-    ///  - Default: Static geometry that physics objects can collide with.
-    ///  - Trigger: Static geometry that can't be collided with but will report touch events.
-    ///  - Dynamic: Dynamic geometry that is a part of a Rigidbody.A set of colliders defines the shape of the parent 
-    ///             rigidbody.
-    /// </summary>
-    public abstract class Collider : ManagedComponent
-    {
-        internal NativeCollider native;
-        protected Rigidbody parent;
-
-        [SerializeField]
-        internal SerializableData serializableData = new SerializableData();
-
-        /// <summary>
-        /// Triggered when some object starts interacting with the collider. Only triggered if proper collision report mode
-        /// is turned on.
-        /// </summary>
-        public event Action<CollisionData> OnCollisionBegin;
-
-        /// <summary>
-        /// Triggered for every frame that an object remains interacting with a collider. Only triggered if proper collision
-        /// report mode is turned on.
-        /// </summary>
-        public event Action<CollisionData> OnCollisionStay;
-
-        /// <summary>
-        /// Triggered when some object stops interacting with the collider. Only triggered if proper collision report mode
-        /// is turned on.
-        /// </summary>
-        public event Action<CollisionData> OnCollisionEnd;
-
-        /// <summary>
-        /// Determines how the collider used. A trigger will not be used for collisions (objects will pass through it),
-        /// but collision events will still be reported.
-        /// </summary>
-        public bool IsTrigger
-        {
-            get { return serializableData.isTrigger; }
-            set
-            {
-                if (serializableData.isTrigger == value)
-                    return;
-
-                serializableData.isTrigger = value;
-
-                if (native != null)
-                {
-                    native.IsTrigger = value;
-                    UpdateParentRigidbody();
-                    UpdateTransform();
-                }
-            }
-        }
-
-        /// <summary>
-        /// Determines mass of the collider. Only relevant if the collider is part of a rigidbody. Ultimately this will 
-        /// determine the total mass, center of mass and inertia tensors of the parent rigidbody(if they're being calculated
-        /// automatically).
-        /// </summary>
-        public float Mass
-        {
-            get { return serializableData.mass; }
-            set
-            {
-                if (serializableData.mass == value)
-                    return;
-
-                serializableData.mass = value;
-
-                if (native != null)
-                {
-                    native.Mass = value;
-
-                    if (parent != null)
-                        parent.UpdateMassDistribution();
-                }
-            }
-        }
-
-        /// <summary>
-        /// Physics material that determines how objects hitting the collider behave.
-        /// </summary>
-        public PhysicsMaterial Material
-        {
-            get { return serializableData.material; }
-            set
-            {
-                serializableData.material = value;
-
-                if (native != null)
-                    native.Material = value;
-            }
-        }
-
-        /// <summary>
-        /// Determines how far apart do two shapes need to be away from each other before the physics runtime starts 
-        /// generating repelling impulse for them.This distance will be the sum of contact offsets of the two interacting
-        /// objects.If objects are moving fast you can increase this value to start generating the impulse earlier and 
-        /// potentially prevent the objects from interpenetrating. This value is in meters. Must be positive and larger
-        /// than <see cref="RestOffset"/>.
-        /// </summary>
-        public float ContactOffset
-        {
-            get { return serializableData.contactOffset; }
-            set
-            {
-                value = MathEx.Max(0, MathEx.Max(value, RestOffset));
-
-                serializableData.contactOffset = value;
-
-                if (native != null)
-                    native.ContactOffset = value;
-            }
-        }
-
-        /// <summary>
-        /// Determines at what distance should two objects resting on one another come to an equilibrium. The value used in the
-        /// runtime will be the sum of rest offsets for both interacting objects. This value is in meters. Cannot be larger
-        /// than <see cref="ContactOffset"/>
-        /// </summary>
-        public float RestOffset
-        {
-            get { return serializableData.restOffset; }
-            set
-            {
-                value = MathEx.Min(value, ContactOffset);
-
-                serializableData.restOffset = value;
-
-                if (native != null)
-                    native.RestOffset = value;
-            }
-        }
-
-        /// <summary>
-        /// Determines with which objects will the collider collide. Objects that are allowed to collide with this
-        /// object must have the same bits set in their own layers.
-        /// </summary>
-        public ulong Layer
-        {
-            get { return serializableData.layer; }
-            set
-            {
-                serializableData.layer = value;
-
-                if (native != null)
-                    native.Layer = value;
-            }
-        }
-
-        /// <summary>
-        /// Determines which (if any) collision events are reported.
-        /// </summary>
-        public CollisionReportMode CollisionReportMode
-        {
-            get { return serializableData.collisionReportMode; }
-            set
-            {
-                serializableData.collisionReportMode = value;
-
-                if (native != null)
-                    UpdateCollisionReportMode();
-            }
-        }
-
-        /// <summary>
-        /// Checks does the ray hit this collider. 
-        /// </summary>
-        /// <param name="ray">Ray to check.</param>
-        /// <param name="hit">Information about the hit. Valid only if the method returns true.</param>
-        /// <param name="maxDist">Maximum distance from the ray origin to search for hits.</param>
-        /// <returns>True if the ray has hit the collider.</returns>
-        public bool Raycast(Ray ray, out PhysicsQueryHit hit, float maxDist)
-        {
-            return Raycast(ray.origin, ray.direction, out hit, maxDist);
-        }
-
-        /// <summary>
-        /// Checks does the ray hit this collider. 
-        /// </summary>
-        /// <param name="origin">Origin of the ray to check.</param>
-        /// <param name="unitDir">Unit direction of the ray to check.</param>
-        /// <param name="hit">Information about the hit. Valid only if the method returns true.</param>
-        /// <param name="maxDist">Maximum distance from the ray origin to search for hits.</param>
-        /// <returns>True if the ray has hit the collider.</returns>
-        public bool Raycast(Vector3 origin, Vector3 unitDir, out PhysicsQueryHit hit, float maxDist = float.MaxValue)
-        {
-            hit = new PhysicsQueryHit();
-
-            if (native == null)
-                return false;
-
-            ScriptPhysicsQueryHit scriptHit;
-            bool wasHit = native.Raycast(origin, unitDir, out scriptHit, maxDist);
-
-            hit.collider = scriptHit.collider.Component;
-            hit.distance = scriptHit.distance;
-            hit.normal = scriptHit.normal;
-            hit.point = scriptHit.point;
-            hit.triangleIdx = scriptHit.triangleIdx;
-            hit.uv = scriptHit.uv;
-
-            return wasHit;
-        }
-
-        /// <summary>
-        /// Creates an internal instance of the collider. Should be overriden by specific collider implementations.
-        /// </summary>
-        /// <returns>An instance of a specific internal collider implementation. </returns>
-        internal abstract NativeCollider CreateCollider();
-
-        /// <summary>
-        /// Changes the rigidbody parent of the collider.
-        /// </summary>
-        /// <param name="rigidbody">New rigidbody to assign as the parent to the collider.</param>
-        /// <param name="isInternal">If true the rigidbody will just be changed internally, but parent rigidbody will not be
-        ///                          notified.</param>
-        internal void SetRigidbody(Rigidbody rigidbody, bool isInternal = false)
-        {
-		    if (rigidbody == parent)
-			    return;
-
-		    if (native != null && !isInternal)
-		    {
-			    if (parent != null)
-                    parent.RemoveCollider(this);
-
-			    NativeRigidbody nativeRigidbody = null;
-
-			    if (rigidbody != null)
-                    nativeRigidbody = rigidbody.native;
-
-		        native.Rigidbody = nativeRigidbody;
-
-			    if (rigidbody != null)
-				    rigidbody.AddCollider(this);
-		    }
-
-		    parent = rigidbody;
-		    UpdateCollisionReportMode();
-	    }
-
-        /// <summary>
-        /// Triggered when the internal collider begins touching another object.
-        /// </summary>
-        /// <param name="data">Data about the collision.</param>
-        internal void DoOnCollisionBegin(CollisionData data)
-        {
-            if (OnCollisionBegin != null)
-                OnCollisionBegin(data);
-        }
-
-        /// <summary>
-        /// Triggered when the internal collider ends touching another object.
-        /// </summary>
-        /// <param name="data">Data about the collision.</param>
-        internal void DoOnCollisionStay(CollisionData data)
-        {
-            if (OnCollisionStay != null)
-                OnCollisionStay(data);
-        }
-
-        /// <summary>
-        /// Triggered when the internal collider ends touching another object.
-        /// </summary>
-        /// <param name="data">Data about the collision.</param>
-        internal void DoOnCollisionEnd(CollisionData data)
-        {
-            if (OnCollisionEnd != null)
-                OnCollisionEnd(data);
-        }
-
-        /// <summary>
-        /// Checks is the provided rigidbody a valid parent for this collider.
-        /// 
-        /// This is required because certain colliders are limited in how they can be used.
-        /// </summary>
-        /// <param name="parent">Rigidbody that is the potential parent.</param>
-        /// <returns>True if collider can be a part of the rigidbody.</returns>
-        protected internal virtual bool IsValidParent(Rigidbody parent)
-        {
-            return true;
-        }
-
-        /// <summary>
-        /// Searches the parent scene object hierarchy to find a parent Rigidbody component.
-        /// </summary>
-        protected void UpdateParentRigidbody()
-        {
-            if (serializableData.isTrigger)
-            {
-                SetRigidbody(null);
-                return;
-            }
-
-            SceneObject currentSO = SceneObject;
-            while (currentSO != null)
-            {
-                Rigidbody parent = currentSO.GetComponent<Rigidbody>();
-                if (parent != null)
-                {
-                    if (currentSO.Active && IsValidParent(parent))
-                        SetRigidbody(parent);
-                    else
-                        SetRigidbody(null);
-
-                    return;
-                }
-
-                currentSO = currentSO.Parent;
-            }
-
-            // Not found
-            SetRigidbody(null);
-        }
-
-        /// <summary>
-        /// Updates the transform of the internal Collider representation from the transform of the component's scene object.
-        /// </summary>
-        protected void UpdateTransform()
-        {
-            Vector3 myScale = SceneObject.Scale;
-
-            if (parent != null)
-            {
-                Vector3 parentPos = parent.SceneObject.Position;
-                Quaternion parentRot = parent.SceneObject.Rotation;
-
-                Vector3 myPos = SceneObject.Position;
-                Quaternion myRot = SceneObject.Rotation;
-
-                Vector3 scale = parent.SceneObject.Scale;
-                Vector3 invScale = scale;
-                if (invScale.x != 0) invScale.x = 1.0f / invScale.x;
-                if (invScale.y != 0) invScale.y = 1.0f / invScale.y;
-                if (invScale.z != 0) invScale.z = 1.0f / invScale.z;
-
-                Quaternion invRotation = parentRot.Inverse;
-
-                Vector3 relativePos = invRotation.Rotate(myPos - parentPos) * invScale;
-                Quaternion relativeRot = invRotation * myRot;
-
-                relativePos = relativePos + myRot.Rotate(serializableData.localPosition * scale);
-                relativeRot = relativeRot * serializableData.localRotation;
-
-                native.Position = relativePos;
-                native.Rotation = relativeRot;
-
-                parent.UpdateMassDistribution();
-            }
-            else
-            {
-                Quaternion myRot = SceneObject.Rotation;
-                Vector3 myPos = SceneObject.Position + myRot.Rotate(serializableData.localPosition * myScale);
-                myRot = myRot * serializableData.localRotation;
-
-                native.Position = myPos;
-                native.Rotation = myRot;
-            }
-
-            native.Scale = myScale;
-        }
-
-        /// <summary>
-        /// Applies the collision report mode to the internal collider depending on the current state.
-        /// </summary>
-        internal void UpdateCollisionReportMode()
-        {
-            CollisionReportMode mode = serializableData.collisionReportMode;
-
-            if (parent != null)
-                mode = parent.CollisionReportMode;
-
-            if(native != null)
-                native.CollisionReportMode = mode;
-        }
-
-        private void OnInitialize()
-        {
-            NotifyFlags = TransformChangedFlags.Transform | TransformChangedFlags.Parent;
-        }
-
-        private void OnEnable()
-        {
-            RestoreNative();
-        }
-
-        private void OnDisable()
-        {
-            DestroyNative();
-        }
-
-        private void OnDestroy()
-        {
-            DestroyNative();
-        }
-
-        private void OnTransformChanged(TransformChangedFlags flags)
-        {
-            if (!SceneObject.Active)
-                return;
-
-            if ((flags & TransformChangedFlags.Parent) != 0)
-                UpdateParentRigidbody();
-
-            // Don't update the transform if it's due to Physics update since then we can guarantee it will remain at the same
-            // relative transform to its parent
-            if (Physics.IsUpdateInProgress)
-                return;
-
-            if ((flags & (TransformChangedFlags.Parent | TransformChangedFlags.Transform)) != 0)
-                UpdateTransform();
-        }
-
-        /// <summary>
-        /// Destroys the internal collider representation.
-        /// </summary>
-        private void DestroyNative()
-        {
-            if (parent != null)
-                parent.RemoveCollider(this);
-
-            parent = null;
-
-            if (native != null)
-            {
-                native.Destroy();
-                native = null;
-            }
-        }
-
-        /// <summary>
-        /// Creates the internal representation of the Collider and restores the values saved by the Component.
-        /// </summary>
-        private void RestoreNative()
-        {
-            native = CreateCollider();
-
-            native.Component = this;
-            native.Position = serializableData.localPosition;
-            native.Rotation = serializableData.localRotation;
-            native.IsTrigger = serializableData.isTrigger;
-            native.Mass = serializableData.mass;
-            native.Material = serializableData.material;
-            native.ContactOffset = serializableData.contactOffset;
-            native.RestOffset = serializableData.restOffset;
-            native.Layer = serializableData.layer;
-
-            UpdateParentRigidbody();
-            UpdateTransform();
-            UpdateCollisionReportMode();
-        }
-
-        /// <summary>
-        /// Holds all data the collider component needs to persist through serialization.
-        /// </summary>
-        [SerializeObject]
-        internal class SerializableData
-        {
-            public Vector3 localPosition = Vector3.Zero;
-            public Quaternion localRotation = Quaternion.Identity;
-            public bool isTrigger = false;
-            public float mass = 1.0f;
-            public PhysicsMaterial material;
-            public float contactOffset = 0.02f;
-            public float restOffset = 0.0f;
-            public ulong layer = 1;
-            public CollisionReportMode collisionReportMode = CollisionReportMode.None;
-        }
-    }
-
-    /** @} */
-}

+ 0 - 299
Source/MBansheeEngine/Physics/D6Joint.cs

@@ -1,299 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-namespace BansheeEngine
-{
-    /** @addtogroup Physics
-     *  @{
-     */
-
-    /// <summary>
-    /// Represents the most customizable type of joint. This joint type can be used to create all other built-in joint 
-    /// types, and to design your own custom ones, but is less intuitive to use. Allows a specification of a linear
-    /// constraint (for example for slider), twist constraint(rotating around X) and swing constraint(rotating around Y and
-    /// Z). It also allows you to constrain limits to only specific axes or completely lock specific axes.
-    /// </summary>
-    public sealed class D6Joint : Joint
-    {
-        [SerializeField]
-        private SerializableData data = new SerializableData();
-
-        /// <summary>
-        /// Returns the current rotation of the joint around the X axis.
-        /// </summary>
-        public Radian Twist
-        {
-            get
-            {
-                if (Native != null)
-                    return Native.Twist;
-
-                return new Radian(0.0f);
-            }
-        }
-
-        /// <summary>
-        /// Returns the current rotation of the joint around the Y axis.
-        /// </summary>
-        public Radian SwingY
-        {
-            get
-            {
-                if (Native != null)
-                    return Native.SwingY;
-
-                return new Radian(0.0f);
-            }
-        }
-
-        /// <summary>
-        /// Returns the current rotation of the joint around the Z axis.
-        /// </summary>
-        public Radian SwingZ
-        {
-            get
-            {
-                if (Native != null)
-                    return Native.SwingZ;
-
-                return new Radian(0.0f);
-            }
-        }
-
-        /// <summary>
-        /// Linear limit used for constraining translation degrees of freedom.
-        /// </summary>
-        public LimitLinear LimitLinear
-        {
-            get { return [email protected]; }
-            set
-            {
-                if ([email protected] == value)
-                    return;
-
-                [email protected] = value;
-
-                if (Native != null)
-                    Native.LimitLinear = value;
-            }
-        }
-
-        /// <summary>
-        /// Angular limit used for constraining the twist (rotation around X) degree of freedom.
-        /// </summary>
-        public LimitAngularRange LimitTwist
-        {
-            get { return [email protected]; }
-            set
-            {
-                if ([email protected] == value)
-                    return;
-
-                [email protected] = value;
-
-                if (Native != null)
-                    Native.LimitTwist = value;
-            }
-        }
-
-        /// <summary>
-        /// Cone limit used for constraining the swing (rotation around Y and Z) degree of freedom.
-        /// </summary>
-        public LimitConeRange LimitSwing
-        {
-            get { return [email protected]; }
-            set
-            {
-                if ([email protected] == value)
-                    return;
-
-                [email protected] = value;
-
-                if (Native != null)
-                    Native.LimitSwing = value;
-            }
-        }
-
-        /// <summary>
-        /// Determines the drive's target position relative to the joint's first body. This is the position the drive will
-        /// attempt to reach if enabled.
-        /// </summary>
-        public Vector3 DrivePosition
-        {
-            get { return [email protected]; }
-            set
-            {
-                if ([email protected] == value)
-                    return;
-
-                [email protected] = value;
-
-                if (Native != null)
-                    Native.DrivePosition = value;
-            }
-        }
-
-        /// <summary>
-        /// Determines the drive's target orientation relative to the joint's first body. This is the orientation the drive
-        /// will attempt to reach if enabled.
-        /// </summary>
-        public Quaternion DriveRotation
-        {
-            get { return [email protected]; }
-            set
-            {
-                if ([email protected] == value)
-                    return;
-
-                [email protected] = value;
-
-                if (Native != null)
-                    Native.DriveRotation = value;
-            }
-        }
-
-        /// <summary>
-        /// Determines the drive's target linear velocity. This is the velocity the drive will attempt to reach if enabled.
-        /// </summary>
-        public Vector3 DriveLinearVelocity
-        {
-            get { return [email protected]; }
-            set
-            {
-                if ([email protected] == value)
-                    return;
-
-                [email protected] = value;
-
-                if (Native != null)
-                    Native.DriveLinearVelocity = value;
-            }
-        }
-
-        /// <summary>
-        /// Determines the drive's target angular velocity. This is the velocity the drive will attempt to reach if enabled.
-        /// </summary>
-        public Vector3 DriveAngularVelocity
-        {
-            get { return [email protected]; }
-            set
-            {
-                if ([email protected] == value)
-                    return;
-
-                [email protected] = value;
-
-                if (Native != null)
-                    Native.DriveAngularVelocity = value;
-            }
-        }
-
-        /// <summary>
-        /// Returns the type of motion constrain for the specified axis.
-        /// </summary>
-        /// <param name="axis">Axis to retrieve the motion constrain for.</param>
-        /// <returns>Motion constrain type for the axis.</returns>
-        public D6JointMotion GetMotion(D6JointAxis axis)
-        {
-            return [email protected][(int) axis];
-        }
-
-        /// <summary>
-        /// Allows you to constrain motion of the specified axis. Be aware that when setting drives for a specific axis
-        /// you must also take care not to constrain its motion in a conflicting way(for example you cannot add a drive
-        /// that moves the joint on X axis, and then lock the X axis).
-        /// 
-        /// Unlocking translations degrees of freedom allows the bodies to move along the subset of the unlocked axes.
-        /// (for example unlocking just one translational axis is the equivalent of a slider joint.)
-        /// 
-        /// Angular degrees of freedom are partitioned as twist(around X axis) and swing(around Y and Z axes). Different
-        /// effects can be achieves by unlocking their various combinations: 
-        ///  - If a single degree of angular freedom is unlocked it should be the twist degree as it has extra options for
-        ///    that case (for example for a hinge joint).
-        ///  - If both swing degrees are unlocked but twist is locked the result is a zero-twist joint.
-        ///  - If one swing and one twist degree of freedom are unlocked the result is a zero-swing joint (for example an 
-        ///    arm attached at the elbow)
-        ///  - If all angular degrees of freedom are unlocked the result is the same as the spherical joint.
-        /// </summary>
-        /// <param name="axis">Axis to change the motion type for.</param>
-        /// <param name="motion">Type of motion for the axis.</param>
-        public void SetMotion(D6JointAxis axis, D6JointMotion motion)
-        {
-            if ([email protected][(int)axis] == motion)
-                return;
-
-            [email protected][(int)axis] = motion;
-
-            if (Native != null)
-                Native.SetMotion(axis, motion);
-        }
-
-        /// <summary>
-        /// Returns properties for the specified drive type.
-        /// </summary>
-        /// <param name="type">Type of drive to retrieve properties for.</param>
-        /// <returns>Properties for the requested drive type.</returns>
-        public D6JointDrive GetDrive(D6JointDriveType type)
-        {
-            return [email protected][(int) type];
-        }
-
-        /// <summary>
-        /// Sets a drive that will attempt to move the specified degree(s) of freedom to the wanted position and velocity. 
-        /// </summary>
-        /// <param name="type">Type of the drive.</param>
-        /// <param name="drive">Drive properties.</param>
-        public void SetDrive(D6JointDriveType type, D6JointDrive drive)
-        {
-            if ([email protected][(int)type] == drive)
-                return;
-
-            [email protected][(int)type] = drive;
-
-            if (Native != null)
-                Native.SetDrive(type, drive);
-        }
-
-        /// <summary>
-        /// Returns the native joint wrapped by this component.
-        /// </summary>
-        private NativeD6Joint Native
-        {
-            get { return (NativeD6Joint)native; }
-        }
-
-        /// <inheritdoc/>
-        internal override NativeJoint CreateNative()
-        {
-            NativeD6Joint joint = new NativeD6Joint(commonData.@internal, data.@internal);
-
-            return joint;
-        }
-
-        /// <summary>
-        /// Holds all data the joint component needs to persist through serialization.
-        /// </summary>
-        [SerializeObject]
-        internal new class SerializableData
-        {
-            public ScriptD6JointData @internal;
-
-            public SerializableData()
-            {
-                @internal.linearLimit = new LimitLinear();
-                @internal.twistLimit = new LimitAngularRange();
-                @internal.swingLimit = new LimitConeRange();
-                @internal.motion = new D6JointMotion[(int)D6JointAxis.Count];
-                @internal.drives = new D6JointDrive[(int)D6JointDriveType.Count];
-                @internal.drivePosition = Vector3.Zero;
-                @internal.driveRotation = Quaternion.Identity;
-                @internal.driveLinearVelocity = Vector3.Zero;
-                @internal.driveAngularVelocity = Vector3.Zero;
-
-                for (int i = 0; i < (int) D6JointAxis.Count; i++)
-                    @internal.drives[i] = new D6JointDrive();
-            }
-        }
-    }
-
-    /** @} */
-}

+ 0 - 225
Source/MBansheeEngine/Physics/DistanceJoint.cs

@@ -1,225 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-
-namespace BansheeEngine
-{
-    /** @addtogroup Physics
-     *  @{
-     */
-
-    /// <summary>
-    /// A joint that maintains an upper or lower (or both) bound on the distance between two bodies.
-    /// </summary>
-    public sealed class DistanceJoint : Joint
-    {
-        /// <summary>
-        /// Flags to control distance joint behaviour.
-        /// </summary>
-        [Flags]
-        internal enum Flag // Note: Must match C++ enum DistanceJoint::Flag
-        {
-            MinDistanceLimit = 0x01,
-            MaxDistanceLimit = 0x02,
-            Spring = 0x04
-        }
-
-        [SerializeField]
-        private SerializableData data = new SerializableData();
-
-        /// <summary>
-        /// Returns the current distance between the two joint bodies.
-        /// </summary>
-        public float Distance
-        {
-            get
-            {
-                if(Native != null)
-                    return Native.Distance;
-
-                return 0.0f;
-            }
-        }
-
-        /// <summary>
-        /// Determines the minimum distance the bodies are allowed to be at, they will get no closer. You must enable
-        /// <see cref="EnableMinDistanceLimit"/> in order for this to be enforced.
-        /// </summary>
-        public float MinDistance
-        {
-            get { return [email protected]; }
-            set
-            {
-                if ([email protected] == value)
-                    return;
-
-                [email protected] = value;
-
-                if (Native != null)
-                    Native.MinDistance = value;
-            }
-        }
-
-        /// <summary>
-        /// Determines the maximum distance the bodies are allowed to be at, they will get no further. You must enable
-        /// <see cref="EnableMaxDistanceLimit"/> in order for this to be enforced.
-        /// </summary>
-        public float MaxDistance
-        {
-            get { return [email protected]; }
-            set
-            {
-                if ([email protected] == value)
-                    return;
-
-                [email protected] = value;
-
-                if (Native != null)
-                    Native.MaxDistance = value;
-            }
-        }
-
-        /// <summary>
-        /// Determines the error tolerance of the joint at which the joint becomes active. This value slightly extends the
-        /// lower and upper limit for precision reasons.
-        /// </summary>
-        public float Tolerance
-        {
-            get { return [email protected]; }
-            set
-            {
-                if ([email protected] == value)
-                    return;
-
-                [email protected] = value;
-
-                if (Native != null)
-                    Native.Tolerance = value;
-            }
-        }
-
-        /// <summary>
-        /// Returns a spring that controls how the joint responds when a limit is reached. You must enable 
-        /// <see cref="EnableSpring"/> in order for the spring to be applied.
-        /// </summary>
-        public Spring Spring
-        {
-            get { return [email protected]; }
-            set
-            {
-                if ([email protected] == value)
-                    return;
-
-                [email protected] = value;
-
-                if (Native != null)
-                    Native.Spring = value;
-            }
-        }
-
-        /// <summary>
-        /// Enables or disables the limit that causes joint objects to maintain a minimum distance between themselves.
-        /// </summary>
-        public bool EnableMinDistanceLimit
-        {
-            get { return ([email protected] & Flag.MinDistanceLimit) != 0; }
-            set
-            {
-                if (!SetFlag(Flag.MinDistanceLimit, value))
-                    return;
-
-                if (Native != null)
-                    Native.EnableMinDistanceLimit = value;
-            }
-        }
-
-        /// <summary>
-        /// Enables or disables the limit that causes joint objects to maintain a maximum distance between themselves.
-        /// </summary>
-        public bool EnableMaxDistanceLimit
-        {
-            get { return ([email protected] & Flag.MaxDistanceLimit) != 0; }
-            set
-            {
-                if (!SetFlag(Flag.MaxDistanceLimit, value))
-                    return;
-
-                if (Native != null)
-                    Native.EnableMinDistanceLimit = value;
-            }
-        }
-
-        /// <summary>
-        /// Enables or disables the spring that controls how the joint reacts when the limit is reached.
-        /// </summary>
-        public bool EnableSpring
-        {
-            get { return ([email protected] & Flag.Spring) != 0; }
-            set
-            {
-                if (!SetFlag(Flag.Spring, value))
-                    return;
-
-                if (Native != null)
-                    Native.EnableSpring = value;
-            }
-        }
-
-        /// <summary>
-        /// Toggles a specific distance joint flag on or off.
-        /// </summary>
-        /// <param name="flag">Flag to toggle.</param>
-        /// <param name="enabled">Should the flag be turned on or off.</param>
-        /// <returns>True if the new newly set flag state was different from the previous one.</returns>
-        private bool SetFlag(Flag flag, bool enabled)
-        {
-            Flag newFlags = [email protected];
-
-            if (enabled)
-                newFlags |= flag;
-            else
-                newFlags &= ~flag;
-
-            if (newFlags == [email protected])
-                return false;
-
-            [email protected] = newFlags;
-            return true;
-        }
-
-        /// <summary>
-        /// Returns the native joint wrapped by this component.
-        /// </summary>
-        private NativeDistanceJoint Native
-        {
-            get { return (NativeDistanceJoint)native; }
-        }
-
-        /// <inheritdoc/>
-        internal override NativeJoint CreateNative()
-        {
-            NativeDistanceJoint joint = new NativeDistanceJoint(commonData.@internal, data.@internal);
-
-            return joint;
-        }
-
-        /// <summary>
-        /// Holds all data the joint component needs to persist through serialization.
-        /// </summary>
-        [SerializeObject]
-        internal new class SerializableData
-        {
-            public ScriptDistanceJointData @internal;
-
-            public SerializableData()
-            {
-                @internal.minDistance = 0.0f;
-                @internal.maxDistance = 0.0f;
-                @internal.tolerance = 0.25f;
-                @internal.flags = 0;
-            }
-        }
-    }
-
-    /** @} */
-}

+ 0 - 54
Source/MBansheeEngine/Physics/FixedJoint.cs

@@ -1,54 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-namespace BansheeEngine
-{
-    /** @addtogroup Physics
-     *  @{
-     */
-
-    /// <summary>
-    /// Physics joint that will maintain a fixed distance and orientation between its two attached bodies.
-    /// </summary>
-    public sealed class FixedJoint : Joint
-    {
-        /// <inheritdoc/>
-        protected override void GetLocalTransform(JointBody body, out Vector3 position, out Quaternion rotation)
-        {
-            position = commonData.positions[(int)body];
-            rotation = commonData.rotations[(int)body];
-
-            Rigidbody rigidbody = commonData.bodies[(int)body];
-            if (rigidbody == null) // Get world space transform if not relative to any body
-            {
-                Quaternion worldRot = SceneObject.Rotation;
-
-                rotation = worldRot * rotation;
-                position = worldRot.Rotate(position) + SceneObject.Position;
-            }
-            else // Get transform of the object relative to the joint
-            {
-                // Find world space transform
-                Quaternion worldRot = rigidbody.SceneObject.Rotation;
-
-                rotation = worldRot * rotation;
-                position = worldRot.Rotate(position) + rigidbody.SceneObject.Position;
-
-                // Get transform of the joint local to the object
-                Quaternion invRotation = rotation.Inverse;
-
-                position = invRotation.Rotate(SceneObject.Position - position);
-                rotation = invRotation * SceneObject.Rotation;
-            }
-        }
-
-        /// <inheritdoc/>
-        internal override NativeJoint CreateNative()
-        {
-            NativeFixedJoint joint = new NativeFixedJoint(commonData.@internal);
-
-            return joint;
-        }
-    }
-
-    /** @} */
-}

+ 0 - 184
Source/MBansheeEngine/Physics/HingeJoint.cs

@@ -1,184 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-
-namespace BansheeEngine
-{
-    /** @addtogroup Physics
-     *  @{
-     */
-
-    /// <summary>
-    /// Hinge joint removes all but a single rotation degree of freedom from its two attached bodies (for example a door
-    /// hinge).
-    /// </summary>
-    public sealed class HingeJoint : Joint
-    {
-        /// <summary>
-        /// Flags to control hinge joint behaviour.
-        /// </summary>
-        [Flags]
-        internal enum Flag // Note: Must match C++ enum HingeJoint::Flag
-        {
-            Limit = 0x01,
-            Drive = 0x02,
-        }
-
-        [SerializeField]
-        private SerializableData data = new SerializableData();
-
-        /// <summary>
-        /// Returns the current angle between the two attached bodes.
-        /// </summary>
-        public Radian Angle
-        {
-            get
-            {
-                if (Native != null)
-                    return Native.Angle;
-
-                return new Radian(0.0f);
-            }
-        }
-
-        /// <summary>
-        /// Returns the current angular speed of the joint.
-        /// </summary>
-        public float Speed
-        {
-            get
-            {
-                if (Native != null)
-                    return Native.Speed;
-
-                return 0.0f;
-            }
-        }
-
-        /// <summary>
-        /// Determines the limit of the joint. Limit constrains the motion to the specified angle range. You must enable
-        /// <see cref="EnableLimit"/> for this to be enforced.
-        /// </summary>
-        public LimitAngularRange Limit
-        {
-            get { return [email protected]; }
-            set
-            {
-                if ([email protected] == value)
-                    return;
-
-                [email protected] = value;
-
-                if (Native != null)
-                    Native.Limit = value;
-            }
-        }
-
-        /// <summary>
-        /// Determines the drive properties of the joint. It drives the joint's angular velocity towards a particular value.
-        /// You must enable <see cref="EnableDrive"/> for this to be applied.
-        /// </summary>
-        public HingeJointDrive Drive
-        {
-            get { return [email protected]; }
-            set
-            {
-                if ([email protected] == value)
-                    return;
-
-                [email protected] = value;
-
-                if (Native != null)
-                    Native.Drive = value;
-            }
-        }
-
-        /// <summary>
-        /// Enables or disables a limit that contrains the joint's motion to a specified angle range.
-        /// </summary>
-        public bool EnableLimit
-        {
-            get { return ([email protected] & Flag.Limit) != 0; }
-            set
-            {
-                if (!SetFlag(Flag.Limit, value))
-                    return;
-
-                if (Native != null)
-                    Native.EnableLimit = value;
-            }
-        }
-
-        /// <summary>
-        /// Enables or disables a drive that drives the joint's angular velocity towards a particular value.
-        /// </summary>
-        public bool EnableDrive
-        {
-            get { return ([email protected] & Flag.Drive) != 0; }
-            set
-            {
-                if (!SetFlag(Flag.Drive, value))
-                    return;
-
-                if (Native != null)
-                    Native.EnableDrive = value;
-            }
-        }
-
-        /// <summary>
-        /// Returns the native joint wrapped by this component.
-        /// </summary>
-        private NativeHingeJoint Native
-        {
-            get { return (NativeHingeJoint)native; }
-        }
-
-        /// <summary>
-        /// Toggles a specific distance joint flag on or off.
-        /// </summary>
-        /// <param name="flag">Flag to toggle.</param>
-        /// <param name="enabled">Should the flag be turned on or off.</param>
-        /// <returns>True if the new newly set flag state was different from the previous one.</returns>
-        private bool SetFlag(Flag flag, bool enabled)
-        {
-            Flag newFlags = [email protected];
-
-            if (enabled)
-                newFlags |= flag;
-            else
-                newFlags &= ~flag;
-
-            if (newFlags == [email protected])
-                return false;
-
-            [email protected] = newFlags;
-            return true;
-        }
-
-        /// <inheritdoc/>
-        internal override NativeJoint CreateNative()
-        {
-            NativeHingeJoint joint = new NativeHingeJoint(commonData.@internal, data.@internal);
-
-            return joint;
-        }
-
-        /// <summary>
-        /// Holds all data the joint component needs to persist through serialization.
-        /// </summary>
-        [SerializeObject]
-        internal new class SerializableData
-        {
-            public ScriptHingeJointData @internal;
-
-            public SerializableData()
-            {
-                @internal.limit = new LimitAngularRange();
-                @internal.drive = new HingeJointDrive();
-                @internal.flags = 0;
-            }
-        }
-    }
-
-    /** @} */
-}

+ 0 - 42
Source/MBansheeEngine/Physics/Interop/NativeBoxCollider.cs

@@ -1,42 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-
-namespace BansheeEngine
-{
-    /** @cond INTEROP */
-    /** @addtogroup Interop
-     *  @{
-     */
-
-    /// <summary>
-    /// Wrapper around the native BoxCollider class.
-    /// <see cref="BoxCollider"/>
-    /// </summary>
-    internal class NativeBoxCollider : NativeCollider
-    {
-        public NativeBoxCollider()
-        {
-            Internal_CreateInstance(this);
-        }
-
-        public Vector3 Extents
-        {
-            get { Vector3 extents; Internal_GetExtents(mCachedPtr, out extents); return extents; }
-            set { Internal_SetExtents(mCachedPtr, ref value); }
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(NativeBoxCollider instance);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetExtents(IntPtr thisPtr, ref Vector3 extents);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetExtents(IntPtr thisPtr, out Vector3 extents);
-    }
-
-    /** @} */
-    /** @endcond */
-}

+ 0 - 54
Source/MBansheeEngine/Physics/Interop/NativeCapsuleCollider.cs

@@ -1,54 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-
-namespace BansheeEngine
-{
-    /** @cond INTEROP */
-    /** @addtogroup Interop
-     *  @{
-     */
-
-    /// <summary>
-    /// Wrapper around the native CapsuleCollider class.
-    /// <see cref="CapsuleCollider"/>
-    /// </summary>
-    internal class NativeCapsuleCollider : NativeCollider
-    {
-        public NativeCapsuleCollider()
-        {
-            Internal_CreateInstance(this);
-        }
-
-        public float Radius
-        {
-            get { return Internal_GetRadius(mCachedPtr); }
-            set { Internal_SetRadius(mCachedPtr, value); }
-        }
-
-        public float HalfHeight
-        {
-            get { return Internal_GetHalfHeight(mCachedPtr); }
-            set { Internal_SetHalfHeight(mCachedPtr, value); }
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(NativeCapsuleCollider instance);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetHalfHeight(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetHalfHeight(IntPtr thisPtr, float radius);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetRadius(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetRadius(IntPtr thisPtr, float radius);
-    }
-
-    /** @} */
-    /** @endcond */
-}

+ 0 - 195
Source/MBansheeEngine/Physics/Interop/NativeCharacterController.cs

@@ -1,195 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-
-namespace BansheeEngine
-{
-    /** @cond INTEROP */
-    /** @addtogroup Interop
-     *  @{
-     */
-
-    /// <summary>
-    /// Wrapper around the native CharacterController class.
-    /// <see cref="CharacterController"/>
-    /// </summary>
-    internal class NativeCharacterController : ScriptObject
-    {
-        private CharacterController component;
-
-        /// <summary>
-        /// Component that owns the native character controller object.
-        /// </summary>
-        public CharacterController Component
-        {
-            get { return component; }
-            set { component = value; }
-        }
-
-        public Vector3 Position
-        {
-            get { Vector3 pos; Internal_GetPosition(mCachedPtr, out pos); return pos; }
-            set { Internal_SetPosition(mCachedPtr, ref value); }
-        }
-
-        public Vector3 FootPosition
-        {
-            get { Vector3 pos; Internal_GetFootPosition(mCachedPtr, out pos); return pos; }
-            set { Internal_SetFootPosition(mCachedPtr, ref value); }
-        }
-
-        public float Radius
-        {
-            set { Internal_SetRadius(mCachedPtr, value); }
-        }
-
-        public float Height
-        {
-            set { Internal_SetHeight(mCachedPtr, value); }
-        }
-
-        public Vector3 Up
-        {
-            set { Internal_SetUp(mCachedPtr, ref value); }
-        }
-
-        public CharacterClimbingMode ClimbingMode
-        {
-            set { Internal_SetClimbingMode(mCachedPtr, value); }
-        }
-
-        public CharacterNonWalkableMode NonWalkableMode
-        {
-            set { Internal_SetNonWalkableMode(mCachedPtr, value); }
-        }
-
-        public float MinMoveDistance
-        {
-            set { Internal_SetMinMoveDistance(mCachedPtr, value); }
-        }
-
-        public float ContactOffset
-        {
-            set { Internal_SetContactOffset(mCachedPtr, value); }
-        }
-
-        public float StepOffset
-        {
-            set { Internal_SetStepOffset(mCachedPtr, value); }
-        }
-
-        public Radian SlopeLimit
-        {
-            set { Internal_SetSlopeLimit(mCachedPtr, value.Radians); }
-        }
-
-        public ulong Layer
-        {
-            set { Internal_SetLayer(mCachedPtr, value); }
-        }
-
-        public NativeCharacterController(ScriptCharacterControllerData initData)
-        {
-            Internal_CreateInstance(this, ref initData);
-        }
-
-        public void Destroy()
-        {
-            Internal_Destroy(mCachedPtr);
-        }
-
-        public CharacterCollisionFlag Move(Vector3 position)
-        {
-            return Internal_Move(mCachedPtr, ref position);
-        }
-
-        private void Internal_DoOnColliderHit(ScriptControllerCollision scriptCollisionData)
-        {
-            ControllerColliderCollision collisionData = new ControllerColliderCollision();
-            collisionData.position = scriptCollisionData.position;
-            collisionData.normal = scriptCollisionData.normal;
-            collisionData.motionDir = scriptCollisionData.motionDir;
-            collisionData.motionAmount = scriptCollisionData.motionAmount;
-            collisionData.triangleIndex = scriptCollisionData.triangleIndex;
-
-            if(scriptCollisionData.collider != null)
-                collisionData.collider = scriptCollisionData.collider.Component;
-            else
-                collisionData.collider = null;
-
-            Component.DoOnColliderHit(collisionData);
-        }
-
-        private void Internal_DoOnControllerHit(ScriptControllerCollision scriptCollisionData)
-        {
-            ControllerControllerCollision collisionData = new ControllerControllerCollision();
-            collisionData.position = scriptCollisionData.position;
-            collisionData.normal = scriptCollisionData.normal;
-            collisionData.motionDir = scriptCollisionData.motionDir;
-            collisionData.motionAmount = scriptCollisionData.motionAmount;
-
-            if (scriptCollisionData.controller != null)
-                collisionData.controller = scriptCollisionData.controller.Component;
-            else
-                collisionData.controller = null;
-
-            Component.DoOnControllerHit(collisionData);
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(NativeCharacterController instance, 
-            ref ScriptCharacterControllerData initData);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_Destroy(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern CharacterCollisionFlag Internal_Move(IntPtr thisPtr, ref Vector3 position);
-        
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetPosition(IntPtr thisPtr, out Vector3 position);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetPosition(IntPtr thisPtr, ref Vector3 position);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetFootPosition(IntPtr thisPtr, out Vector3 position);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetFootPosition(IntPtr thisPtr, ref Vector3 position);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetRadius(IntPtr thisPtr, float radius);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetHeight(IntPtr thisPtr, float height);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetUp(IntPtr thisPtr, ref Vector3 up);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetClimbingMode(IntPtr thisPtr, CharacterClimbingMode mode);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetNonWalkableMode(IntPtr thisPtr, CharacterNonWalkableMode mode);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetMinMoveDistance(IntPtr thisPtr, float value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetContactOffset(IntPtr thisPtr, float value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetStepOffset(IntPtr thisPtr, float value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetSlopeLimit(IntPtr thisPtr, float value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetLayer(IntPtr thisPtr, ulong layer);
-    }
-
-    /** @} */
-    /** @endcond */
-}

+ 0 - 208
Source/MBansheeEngine/Physics/Interop/NativeCollider.cs

@@ -1,208 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-
-namespace BansheeEngine
-{
-    /** @cond INTEROP */
-    /** @addtogroup Interop
-     *  @{
-     */
-
-    /// <summary>
-    /// Wrapper around the native Collider class.
-    /// <see cref="Collider"/>
-    /// </summary>
-    internal class NativeCollider : ScriptObject
-    {
-        private Collider component;
-
-        /// <summary>
-        /// Component that owns the native collider object.
-        /// </summary>
-        public Collider Component
-        {
-            get { return component; }
-            set { component = value; }
-        }
-
-        public Vector3 Position
-        {
-            get { Vector3 pos; Internal_GetPosition(mCachedPtr, out pos); return pos; }
-            set { Quaternion rot = Rotation; Internal_SetTransform(mCachedPtr, ref value, ref rot); }
-        }
-
-        public Quaternion Rotation
-        {
-            get { Quaternion rot; Internal_GetRotation(mCachedPtr, out rot); return rot; }
-            set { Vector3 pos = Position; Internal_SetTransform(mCachedPtr, ref pos, ref value); }
-        }
-
-        public Vector3 Scale
-        {
-            get { Vector3 scale; Internal_GetScale(mCachedPtr, out scale); return scale; }
-            set { Internal_SetScale(mCachedPtr, ref value); }
-        }
-
-        public bool IsTrigger
-        {
-            get { return Internal_GetIsTrigger(mCachedPtr); }
-            set { Internal_SetIsTrigger(mCachedPtr, value); }
-        }
-
-        public NativeRigidbody Rigidbody
-        {
-            get { return Internal_GetRigidbody(mCachedPtr); }
-            set
-            {
-                IntPtr rigidbodyPtr = IntPtr.Zero;
-                if (value != null)
-                    rigidbodyPtr = value.GetCachedPtr();
-
-                Internal_SetRigidbody(mCachedPtr, rigidbodyPtr);
-            }
-        }
-
-        public float Mass
-        {
-            get { return Internal_GetMass(mCachedPtr); }
-            set { Internal_SetMass(mCachedPtr, value); }
-        }
-
-        public PhysicsMaterial Material
-        {
-            get { return Internal_GetMaterial(mCachedPtr); }
-            set
-            {
-                IntPtr materialPtr = IntPtr.Zero;
-                if (value != null)
-                    materialPtr = value.GetCachedPtr();
-
-                Internal_SetMaterial(mCachedPtr, materialPtr);
-            }
-        }
-
-        public float ContactOffset
-        {
-            get { return Internal_GetContactOffset(mCachedPtr); }
-            set { Internal_SetContactOffset(mCachedPtr, value); }
-        }
-
-        public float RestOffset
-        {
-            get { return Internal_GetRestOffset(mCachedPtr); }
-            set { Internal_SetRestOffset(mCachedPtr, value); }
-        }
-
-        public ulong Layer
-        {
-            get { return Internal_GetLayer(mCachedPtr); }
-            set { Internal_SetLayer(mCachedPtr, value); }
-        }
-
-        public CollisionReportMode CollisionReportMode
-        {
-            get { return Internal_GetCollisionReportMode(mCachedPtr); }
-            set { Internal_SetCollisionReportMode(mCachedPtr, value); }
-        }
-
-        public bool Raycast(Vector3 origin, Vector3 unitDir, out ScriptPhysicsQueryHit hit, float maxDist)
-        {
-            return Internal_RayCast(mCachedPtr, ref origin, ref unitDir, out hit, maxDist);
-        }
-
-        public void Destroy()
-        {
-            Internal_Destroy(mCachedPtr);
-        }
-
-        private void Internal_DoOnCollisionBegin(ScriptCollisionData scriptCollisionData)
-        {
-            Component.DoOnCollisionBegin(new CollisionData(scriptCollisionData));
-        }
-
-        private void Internal_DoOnCollisionStay(ScriptCollisionData scriptCollisionData)
-        {
-            Component.DoOnCollisionStay(new CollisionData(scriptCollisionData));
-        }
-
-        private void Internal_DoOnCollisionEnd(ScriptCollisionData scriptCollisionData)
-        {
-            Component.DoOnCollisionEnd(new CollisionData(scriptCollisionData));
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_Destroy(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetPosition(IntPtr thisPtr, out Vector3 pos);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetRotation(IntPtr thisPtr, out Quaternion rot);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetTransform(IntPtr thisPtr, ref Vector3 pos, ref Quaternion rot);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetScale(IntPtr thisPtr, ref Vector3 scale);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetScale(IntPtr thisPtr, out Vector3 scale);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetIsTrigger(IntPtr thisPtr, bool value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern bool Internal_GetIsTrigger(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetRigidbody(IntPtr thisPtr, IntPtr rigidbody);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern NativeRigidbody Internal_GetRigidbody(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetMass(IntPtr thisPtr, float mass);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetMass(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetMaterial(IntPtr thisPtr, IntPtr physicsMaterial);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern PhysicsMaterial Internal_GetMaterial(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetContactOffset(IntPtr thisPtr, float value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetContactOffset(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetRestOffset(IntPtr thisPtr, float value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetRestOffset(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetLayer(IntPtr thisPtr, ulong layer);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern ulong Internal_GetLayer(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetCollisionReportMode(IntPtr thisPtr, CollisionReportMode mode);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern CollisionReportMode Internal_GetCollisionReportMode(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern bool Internal_RayCast(IntPtr thisPtr, ref Vector3 origin, ref Vector3 unitDir, 
-            out ScriptPhysicsQueryHit hit, float maxDist);
-    }
-
-    /** @} */
-    /** @endcond */
-}

+ 0 - 145
Source/MBansheeEngine/Physics/Interop/NativeD6Joint.cs

@@ -1,145 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace BansheeEngine
-{
-    /** @cond INTEROP */
-    /** @addtogroup Interop
-     *  @{
-     */
-
-    /// <summary>
-    /// Wrapper around the native D6Joint class.
-    /// <see cref="D6Joint"/>
-    /// </summary>
-    internal class NativeD6Joint : NativeJoint
-    {
-        public Radian Twist
-        {
-            get { return new Radian(Internal_GetTwist(mCachedPtr)); }
-        }
-
-        public Radian SwingY
-        {
-            get { return new Radian(Internal_GetSwingY(mCachedPtr)); }
-        }
-
-        public Radian SwingZ
-        {
-            get { return new Radian(Internal_GetSwingZ(mCachedPtr)); }
-        }
-
-        public LimitLinear LimitLinear
-        {
-            set { Internal_SetLimitLinear(mCachedPtr, value); }
-        }
-
-        public LimitAngularRange LimitTwist
-        {
-            set { Internal_SetLimitTwist(mCachedPtr, value); }
-        }
-
-        public LimitConeRange LimitSwing
-        {
-            set { Internal_SetLimitSwing(mCachedPtr, value); }
-        }
-
-        public Vector3 DrivePosition
-        {
-            set { Internal_SetDrivePosition(mCachedPtr, ref value); }
-        }
-
-        public Quaternion DriveRotation
-        {
-            set { Internal_SetDriveRotation(mCachedPtr, ref value); }
-        }
-
-        public Vector3 DriveLinearVelocity
-        {
-            set { Internal_SetDriveLinearVelocity(mCachedPtr, ref value); }
-        }
-
-        public Vector3 DriveAngularVelocity
-        {
-            set { Internal_SetDriveAngularVelocity(mCachedPtr, ref value); }
-        }
-
-        public void SetMotion(D6JointAxis axis, D6JointMotion motion)
-        {
-            Internal_SetMotion(mCachedPtr, axis, motion);
-        }
-
-        public void SetDrive(D6JointDriveType type, D6JointDrive drive)
-        {
-            Internal_SetDrive(mCachedPtr, type, drive);
-        }
-
-        public NativeD6Joint(ScriptCommonJointData commonData, ScriptD6JointData data)
-        {
-            Internal_CreateInstance(this, ref commonData, ref data);
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(NativeD6Joint instance, ref ScriptCommonJointData commonData,
-            ref ScriptD6JointData data);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetMotion(IntPtr thisPtr, D6JointAxis axis, D6JointMotion motion);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetTwist(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetSwingY(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetSwingZ(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetLimitLinear(IntPtr thisPtr, LimitLinear limit);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetLimitTwist(IntPtr thisPtr, LimitAngularRange limit);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetLimitSwing(IntPtr thisPtr, LimitConeRange limit);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetDrive(IntPtr thisPtr, D6JointDriveType type, D6JointDrive drive);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetDrivePosition(IntPtr thisPtr, ref Vector3 position);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetDriveRotation(IntPtr thisPtr, ref Quaternion rotation);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetDriveLinearVelocity(IntPtr thisPtr, ref Vector3 velocity);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetDriveAngularVelocity(IntPtr thisPtr, ref Vector3 velocity);
-    }
-
-    /// <summary>
-    /// Used for passing D6Joint initialization data between native and managed code.
-    /// </summary>
-    [StructLayout(LayoutKind.Sequential), SerializeObject]
-    internal struct ScriptD6JointData // Note: Must match C++ struct ScriptD6JointData
-    {
-        public LimitLinear linearLimit;
-        public LimitAngularRange twistLimit;
-        public LimitConeRange swingLimit;
-        public D6JointMotion[] motion;
-        public D6JointDrive[] drives;
-        public Vector3 drivePosition;
-        public Quaternion driveRotation;
-        public Vector3 driveLinearVelocity;
-        public Vector3 driveAngularVelocity;
-    }
-
-    /** @} */
-    /** @endcond */
-}

+ 0 - 109
Source/MBansheeEngine/Physics/Interop/NativeDistanceJoint.cs

@@ -1,109 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace BansheeEngine
-{
-    /** @cond INTEROP */
-    /** @addtogroup Interop
-     *  @{
-     */
-
-    /// <summary>
-    /// Wrapper around the native DistanceJoint class.
-    /// <see cref="DistanceJoint"/>
-    /// </summary>
-    internal class NativeDistanceJoint : NativeJoint
-    {
-        public float Distance
-        {
-            get { return Internal_GetDistance(mCachedPtr); }
-        }
-
-        public float MinDistance
-        {
-            set { Internal_SetMinDistance(mCachedPtr, value); }
-        }
-
-        public float MaxDistance
-        {
-            set { Internal_SetMaxDistance(mCachedPtr, value); }
-        }
-
-        public float Tolerance
-        {
-            set { Internal_SetTolerance(mCachedPtr, value); }
-        }
-
-        public Spring Spring
-        {
-            set { Internal_SetSpring(mCachedPtr, ref value); }
-        }
-
-        public bool EnableMinDistanceLimit
-        {
-            set { Internal_SetEnableMinDistanceLimit(mCachedPtr, value); }
-        }
-
-        public bool EnableMaxDistanceLimit
-        {
-            set { Internal_SetEnableMaxDistanceLimit(mCachedPtr, value); }
-        }
-
-        public bool EnableSpring
-        {
-            set { Internal_SetEnableSpring(mCachedPtr, value); }
-        }
-
-        public NativeDistanceJoint(ScriptCommonJointData commonData, ScriptDistanceJointData data)
-        {
-            Internal_CreateInstance(this, ref commonData, ref data);
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(NativeDistanceJoint instance, ref ScriptCommonJointData commonData,
-           ref ScriptDistanceJointData data);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetDistance(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetMinDistance(IntPtr thisPtr, float value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetMaxDistance(IntPtr thisPtr, float value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetTolerance(IntPtr thisPtr, float value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetSpring(IntPtr thisPtr, ref Spring value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetEnableMinDistanceLimit(IntPtr thisPtr, bool value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetEnableMaxDistanceLimit(IntPtr thisPtr, bool value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetEnableSpring(IntPtr thisPtr, bool value);
-    }
-
-    /// <summary>
-    /// Used for passing DistanceJoint initialization data between native and managed code.
-    /// </summary>
-    [StructLayout(LayoutKind.Sequential), SerializeObject]
-    internal struct ScriptDistanceJointData // Note: Must match C++ struct ScriptDistanceJointData
-    {
-        public float minDistance;
-        public float maxDistance;
-        public float tolerance;
-        public Spring spring;
-        public DistanceJoint.Flag flags;
-    }
-
-    /** @} */
-    /** @endcond */
-}

+ 0 - 29
Source/MBansheeEngine/Physics/Interop/NativeFixedJoint.cs

@@ -1,29 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System.Runtime.CompilerServices;
-
-namespace BansheeEngine
-{
-    /** @cond INTEROP */
-    /** @addtogroup Interop
-     *  @{
-     */
-
-    /// <summary>
-    /// Wrapper around the native FixedJoint class.
-    /// <see cref="FixedJoint"/>
-    /// </summary>
-    internal class NativeFixedJoint : NativeJoint
-    {
-        public NativeFixedJoint(ScriptCommonJointData commonData)
-        {
-            Internal_CreateInstance(this, ref commonData);
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(NativeFixedJoint instance, ref ScriptCommonJointData commonData);
-    }
-
-    /** @} */
-    /** @endcond */
-}

+ 0 - 91
Source/MBansheeEngine/Physics/Interop/NativeHingeJoint.cs

@@ -1,91 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace BansheeEngine
-{
-    /** @cond INTEROP */
-    /** @addtogroup Interop
-     *  @{
-     */
-
-    /// <summary>
-    /// Wrapper around the native HingeJoint class.
-    /// <see cref="HingeJoint"/>
-    /// </summary>
-    internal class NativeHingeJoint : NativeJoint
-    {
-        public Radian Angle
-        {
-            get { return new Radian(Internal_GetAngle(mCachedPtr)); }
-        }
-
-        public float Speed
-        {
-            get { return Internal_GetSpeed(mCachedPtr); }
-        }
-
-        public LimitAngularRange Limit
-        {
-            set { Internal_SetLimit(mCachedPtr, value); }
-        }
-
-        public HingeJointDrive Drive
-        {
-            set { Internal_SetDrive(mCachedPtr, value); }
-        }
-
-        public bool EnableLimit
-        {
-            set { Internal_SetEnableLimit(mCachedPtr, value); }
-        }
-
-        public bool EnableDrive
-        {
-            set { Internal_SetEnableDrive(mCachedPtr, value); }
-        }
-
-        public NativeHingeJoint(ScriptCommonJointData commonData, ScriptHingeJointData data)
-        {
-            Internal_CreateInstance(this, ref commonData, ref data);
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(NativeHingeJoint instance, ref ScriptCommonJointData commonData,
-            ref ScriptHingeJointData data);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetAngle(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetSpeed(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetLimit(IntPtr thisPtr, LimitAngularRange limit);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetDrive(IntPtr thisPtr, HingeJointDrive drive);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetEnableLimit(IntPtr thisPtr, bool enable);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetEnableDrive(IntPtr thisPtr, bool enable);
-    }
-
-    /// <summary>
-    /// Used for passing HingeJoint initialization data between native and managed code.
-    /// </summary>
-    [StructLayout(LayoutKind.Sequential), SerializeObject]
-    internal struct ScriptHingeJointData // Note: Must match C++ struct ScriptHingeJointData
-    {
-        public LimitAngularRange limit;
-        public HingeJointDrive drive;
-        public HingeJoint.Flag flags;
-    }
-
-    /** @} */
-    /** @endcond */
-}

+ 0 - 113
Source/MBansheeEngine/Physics/Interop/NativeJoint.cs

@@ -1,113 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace BansheeEngine
-{
-    /** @cond INTEROP */
-    /** @addtogroup Interop
-     *  @{
-     */
-
-    /// <summary>
-    /// Wrapper around the native Joint class.
-    /// <see cref="Joint"/>
-    /// </summary>
-    internal class NativeJoint : ScriptObject
-    {
-        private Joint component;
-
-        /// <summary>
-        /// Component that owns the native joint object.
-        /// </summary>
-        public Joint Component
-        {
-            get { return component; }
-            set { component = value; }
-        }
-
-        public float BreakForce
-        {
-            set { Internal_SetBreakForce(mCachedPtr, value); }
-        }
-
-        public float BreakTorque
-        {
-            set { Internal_SetBreakTorque(mCachedPtr, value); }
-        }
-
-        public bool EnableCollision
-        {
-            set { Internal_SetEnableCollision(mCachedPtr, value); }
-        }
-
-        public void SetRigidbody(JointBody body, Rigidbody rigidbody)
-        {
-            IntPtr rigidbodyPtr = IntPtr.Zero;
-            if (rigidbody != null)
-                rigidbodyPtr = rigidbody.native.GetCachedPtr();
-
-            Internal_SetBody(mCachedPtr, body, rigidbodyPtr);
-        }
-
-        public void SetPosition(JointBody body, Vector3 position)
-        {
-            Internal_SetPosition(mCachedPtr, body, ref position);
-        }
-
-        public void SetRotation(JointBody body, Quaternion rotation)
-        {
-            Internal_SetRotation(mCachedPtr, body, ref rotation);
-        }
-        
-        public void Destroy()
-        {
-            Internal_Destroy(mCachedPtr);
-        }
-
-        private void Internal_DoOnJointBreak()
-        {
-            Component.DoOnJointBreak();
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_Destroy(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetBody(IntPtr thisPtr, JointBody body, IntPtr rigidbody);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetPosition(IntPtr thisPtr, JointBody body, ref Vector3 position);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetRotation(IntPtr thisPtr, JointBody body, ref Quaternion rotation);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetBreakForce(IntPtr thisPtr, float force);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetBreakTorque(IntPtr thisPtr, float torque);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetEnableCollision(IntPtr thisPtr, bool value);
-    }
-
-    /// <summary>
-    /// Used for passing common Joint initialization data between native and managed code.
-    /// </summary>
-    [StructLayout(LayoutKind.Sequential), SerializeObject]
-    internal struct ScriptCommonJointData // Note: Must match C++ struct ScriptCommonJointData
-    {
-        public IntPtr[] bodies;
-        public Vector3[] positions;
-        public Quaternion[] rotations;
-        public float breakForce;
-        public float breakTorque;
-        public bool enableCollision;
-    }
-
-    /** @} */
-    /** @endcond */
-}

+ 0 - 49
Source/MBansheeEngine/Physics/Interop/NativeMeshCollider.cs

@@ -1,49 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-
-namespace BansheeEngine
-{
-    /** @cond INTEROP */
-    /** @addtogroup Interop
-     *  @{
-     */
-
-    /// <summary>
-    /// Wrapper around the native MeshCollider class.
-    /// <see cref="MeshCollider"/>
-    /// </summary>
-    internal class NativeMeshCollider : NativeCollider
-    {
-        public NativeMeshCollider()
-        {
-            Internal_CreateInstance(this);
-        }
-
-        public PhysicsMesh Mesh
-        {
-            get { return Internal_GetMesh(mCachedPtr); }
-            set
-            {
-                IntPtr meshPtr = IntPtr.Zero;
-                if (value != null)
-                    meshPtr = value.GetCachedPtr();
-
-                Internal_SetMesh(mCachedPtr, meshPtr);
-            }
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(NativeMeshCollider instance);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern PhysicsMesh Internal_GetMesh(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetMesh(IntPtr thisPtr, IntPtr mesh);
-    }
-
-    /** @} */
-    /** @endcond */
-}

+ 0 - 30
Source/MBansheeEngine/Physics/Interop/NativePlaneCollider.cs

@@ -1,30 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-
-namespace BansheeEngine
-{
-    /** @cond INTEROP */
-    /** @addtogroup Interop
-     *  @{
-     */
-
-    /// <summary>
-    /// Wrapper around the native PlaneCollider class.
-    /// <see cref="PlaneCollider"/>
-    /// </summary>
-    internal class NativePlaneCollider : NativeCollider
-    {
-        public NativePlaneCollider()
-        {
-            Internal_CreateInstance(this);
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(NativePlaneCollider instance);
-    }
-
-    /** @} */
-    /** @endcond */
-}

+ 0 - 377
Source/MBansheeEngine/Physics/Interop/NativeRigidbody.cs

@@ -1,377 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-
-namespace BansheeEngine
-{
-    /** @cond INTEROP */
-    /** @addtogroup Interop
-     *  @{
-     */
-
-    /// <summary>
-    /// Wrapper around the native Rigidbody class.
-    /// <see cref="Rigidbody"/>
-    /// </summary>
-    internal class NativeRigidbody : ScriptObject
-    {
-        private Rigidbody component;
-
-        /// <summary>
-        /// Component that owns the native rigidbody object.
-        /// </summary>
-        public Rigidbody Component
-        {
-            get { return component; }
-            set { component = value; }
-        }
-
-        public Vector3 Position
-        {
-            get { Vector3 pos; Internal_GetPosition(mCachedPtr, out pos); return pos; }
-            set { Quaternion rot = Rotation; Internal_SetTransform(mCachedPtr, ref value, ref rot); }
-        }
-
-        public Quaternion Rotation
-        {
-            get { Quaternion rot; Internal_GetRotation(mCachedPtr, out rot); return rot; }
-            set { Vector3 pos = Position; Internal_SetTransform(mCachedPtr, ref pos, ref value); }
-        }
-
-        public float Mass
-        {
-            get { return Internal_GetMass(mCachedPtr); }
-            set { Internal_SetMass(mCachedPtr, value); }
-        }
-
-        public bool Kinematic
-        {
-            get { return Internal_GetIsKinematic(mCachedPtr); }
-            set { Internal_SetIsKinematic(mCachedPtr, value); }
-        }
-
-        public bool Sleeping
-        {
-            get { return Internal_IsSleeping(mCachedPtr); }
-            set
-            {
-                if (value)
-                    Internal_Sleep(mCachedPtr);
-                else
-                    Internal_WakeUp(mCachedPtr);
-            }
-        }
-
-        public float SleepThreshold
-        {
-            get { return Internal_GetSleepThreshold(mCachedPtr); }
-            set { Internal_SetSleepThreshold(mCachedPtr, value); }
-        }
-
-        public bool UseGravity
-        {
-            get { return Internal_GetUseGravity(mCachedPtr); }
-            set { Internal_SetUseGravity(mCachedPtr, value); }
-        }
-
-        public Vector3 Velocity
-        {
-            get { Vector3 velocity; Internal_GetVelocity(mCachedPtr, out velocity); return velocity; }
-            set { Internal_SetVelocity(mCachedPtr, ref value); }
-        }
-
-        public Vector3 AngularVelocity
-        {
-            get { Vector3 velocity; Internal_GetAngularVelocity(mCachedPtr, out velocity); return velocity; }
-            set { Internal_SetAngularVelocity(mCachedPtr, ref value); }
-        }
-
-        public float Drag
-        {
-            get { return Internal_GetDrag(mCachedPtr); }
-            set { Internal_SetDrag(mCachedPtr, value); }
-        }
-
-        public float AngularDrag
-        {
-            get { return Internal_GetAngularDrag(mCachedPtr); }
-            set { Internal_SetAngularDrag(mCachedPtr, value); }
-        }
-
-        public Vector3 InertiaTensor
-        {
-            get { Vector3 tensor; Internal_GetInertiaTensor(mCachedPtr, out tensor); return tensor; }
-            set { Internal_SetInertiaTensor(mCachedPtr, ref value); }
-        }
-
-        public Vector3 CenterOfMassPosition
-        {
-            get { Vector3 pos; Internal_GetCenterOfMassPosition(mCachedPtr, out pos); return pos; }
-            set { Quaternion rot = CenterOfMassRotation; Internal_SetCenterOfMass(mCachedPtr, ref value, ref rot); }
-        }
-
-        public Quaternion CenterOfMassRotation
-        {
-            get { Quaternion rot; Internal_GetCenterOfMassRotation(mCachedPtr, out rot); return rot; }
-            set { Vector3 pos = CenterOfMassPosition; Internal_SetCenterOfMass(mCachedPtr, ref pos, ref value); }
-        }
-
-        public float MaxAngularVelocity
-        {
-            get { return Internal_GetMaxAngularVelocity(mCachedPtr); }
-            set { Internal_SetMaxAngularVelocity(mCachedPtr, value); }
-        }
-
-        public int PositionSolverCount
-        {
-            get { return Internal_GetPositionSolverCount(mCachedPtr); }
-            set { Internal_SetPositionSolverCount(mCachedPtr, value); }
-        }
-
-        public int VelocitySolverCount
-        {
-            get { return Internal_GetVelocitySolverCount(mCachedPtr); }
-            set { Internal_SetVelocitySolverCount(mCachedPtr, value); }
-        }
-
-        public RigidbodyFlag Flags
-        {
-            get { return Internal_GetFlags(mCachedPtr); }
-            set { Internal_SetFlags(mCachedPtr, value); }
-        }
-
-        public NativeRigidbody(SceneObject linkedSO)
-        {
-            IntPtr linkedSOPtr = IntPtr.Zero;
-            if (linkedSO != null)
-                linkedSOPtr = linkedSO.GetCachedPtr();
-
-            Internal_CreateInstance(this, linkedSOPtr);
-        }
-
-        public void Destroy()
-        {
-            Internal_Destroy(mCachedPtr);
-        }
-
-        public void Move(Vector3 position)
-        {
-            Internal_Move(mCachedPtr, ref position);
-        }
-
-        public void Rotate(Quaternion rotation)
-        {
-            Internal_Rotate(mCachedPtr, ref rotation);
-        }
-
-        public void AddForce(Vector3 force, ForceMode mode)
-        {
-            Internal_AddForce(mCachedPtr, ref force, mode);
-        }
-
-        public void AddTorque(Vector3 torque, ForceMode mode)
-        {
-            Internal_AddTorque(mCachedPtr, ref torque, mode);
-        }
-
-        public void AddForceAtPoint(Vector3 force, Vector3 position, PointForceMode mode)
-        {
-            Internal_AddForceAtPoint(mCachedPtr, ref force, ref position, mode);
-        }
-
-        public Vector3 GetVelocityAtPoint(Vector3 position)
-        {
-            Vector3 velocity;
-            Internal_GetVelocityAtPoint(mCachedPtr, ref position, out velocity);
-            return velocity;
-        }
-
-        public void AddCollider(Collider collider)
-        {
-            if (collider == null || collider.native == null)
-                return;
-
-            IntPtr colliderPtr = collider.native.GetCachedPtr();
-            Internal_AddCollider(mCachedPtr, colliderPtr);
-        }
-
-        public void RemoveCollider(Collider collider)
-        {
-            if (collider == null)
-                return;
-
-            IntPtr colliderPtr = collider.native.GetCachedPtr();
-            Internal_RemoveCollider(mCachedPtr, colliderPtr);
-        }
-
-        public void RemoveColliders()
-        {
-            Internal_RemoveColliders(mCachedPtr);
-        }
-
-        public void UpdateMassDistribution()
-        {
-            Internal_UpdateMassDistribution(mCachedPtr);
-        }
-
-        private void Internal_DoOnCollisionBegin(ScriptCollisionData scriptCollisionData)
-        {
-            Component.DoOnCollisionBegin(new CollisionData(scriptCollisionData));
-        }
-
-        private void Internal_DoOnCollisionStay(ScriptCollisionData scriptCollisionData)
-        {
-            Component.DoOnCollisionStay(new CollisionData(scriptCollisionData));
-        }
-
-        private void Internal_DoOnCollisionEnd(ScriptCollisionData scriptCollisionData)
-        {
-            Component.DoOnCollisionEnd(new CollisionData(scriptCollisionData));
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(NativeRigidbody instance, IntPtr linkedSO);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_Destroy(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_Move(IntPtr thisPtr, ref Vector3 position);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_Rotate(IntPtr thisPtr, ref Quaternion rotation);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetPosition(IntPtr thisPtr, out Vector3 position);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetRotation(IntPtr thisPtr, out Quaternion rotation);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetTransform(IntPtr thisPtr, ref Vector3 pos, ref Quaternion rot);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetMass(IntPtr thisPtr, float mass);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetMass(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetIsKinematic(IntPtr thisPtr, bool kinematic);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern bool Internal_GetIsKinematic(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern bool Internal_IsSleeping(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_Sleep(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_WakeUp(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetSleepThreshold(IntPtr thisPtr, float threshold);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetSleepThreshold(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetUseGravity(IntPtr thisPtr, bool gravity);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern bool Internal_GetUseGravity(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetVelocity(IntPtr thisPtr, ref Vector3 velocity);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetVelocity(IntPtr thisPtr, out Vector3 velocity);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetAngularVelocity(IntPtr thisPtr, ref Vector3 velocity);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetAngularVelocity(IntPtr thisPtr, out Vector3 velocity);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetDrag(IntPtr thisPtr, float drag);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetDrag(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetAngularDrag(IntPtr thisPtr, float drag);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetAngularDrag(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetInertiaTensor(IntPtr thisPtr, ref Vector3 tensor);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetInertiaTensor(IntPtr thisPtr, out Vector3 tensor);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetMaxAngularVelocity(IntPtr thisPtr, float maxVelocity);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetMaxAngularVelocity(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetCenterOfMass(IntPtr thisPtr, ref Vector3 position, ref Quaternion rotation);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetCenterOfMassPosition(IntPtr thisPtr, out Vector3 position);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetCenterOfMassRotation(IntPtr thisPtr, out Quaternion rotation);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetPositionSolverCount(IntPtr thisPtr, int count);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern int Internal_GetPositionSolverCount(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetVelocitySolverCount(IntPtr thisPtr, int count);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern int Internal_GetVelocitySolverCount(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetFlags(IntPtr thisPtr, RigidbodyFlag flags);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern RigidbodyFlag Internal_GetFlags(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_AddForce(IntPtr thisPtr, ref Vector3 force, ForceMode mode);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_AddTorque(IntPtr thisPtr, ref Vector3 torque, ForceMode mode);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_AddForceAtPoint(IntPtr thisPtr, ref Vector3 force, ref Vector3 position, PointForceMode mode);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_GetVelocityAtPoint(IntPtr thisPtr, ref Vector3 point, out Vector3 velocity);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_AddCollider(IntPtr thisPtr, IntPtr collider);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_RemoveCollider(IntPtr thisPtr, IntPtr collider);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_RemoveColliders(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_UpdateMassDistribution(IntPtr thisPtr);
-    }
-
-    /** @} */
-    /** @endcond */
-}

+ 0 - 74
Source/MBansheeEngine/Physics/Interop/NativeSliderJoint.cs

@@ -1,74 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace BansheeEngine
-{
-    /** @cond INTEROP */
-    /** @addtogroup Interop
-     *  @{
-     */
-
-    /// <summary>
-    /// Wrapper around the native SliderJoint class.
-    /// <see cref="SliderJoint"/>
-    /// </summary>
-    internal class NativeSliderJoint : NativeJoint
-    {
-        public float Position
-        {
-            get { return Internal_GetPosition(mCachedPtr); }
-        }
-
-        public float Speed
-        {
-            get { return Internal_GetSpeed(mCachedPtr); }
-        }
-
-        public LimitLinearRange Limit
-        {
-            set { Internal_SetLimit(mCachedPtr, value); }
-        }
-
-        public bool EnableLimit
-        {
-            set { Internal_SetEnableLimit(mCachedPtr, value); }
-        }
-
-        public NativeSliderJoint(ScriptCommonJointData commonData, ScriptSliderJointData data)
-        {
-            Internal_CreateInstance(this, ref commonData, ref data);
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(NativeSliderJoint instance, ref ScriptCommonJointData commonData,
-            ref ScriptSliderJointData data);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetPosition(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetSpeed(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetLimit(IntPtr thisPtr, LimitLinearRange limit);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetEnableLimit(IntPtr thisPtr, bool enable);
-    }
-
-    /// <summary>
-    /// Used for passing SliderJoint initialization data between native and managed code.
-    /// </summary>
-    [StructLayout(LayoutKind.Sequential), SerializeObject]
-    internal struct ScriptSliderJointData // Note: Must match C++ struct ScriptSliderJointData
-    {
-        public LimitLinearRange limit;
-        public bool enableLimit;
-    }
-
-    /** @} */
-    /** @endcond */
-}

+ 0 - 42
Source/MBansheeEngine/Physics/Interop/NativeSphereCollider.cs

@@ -1,42 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-
-namespace BansheeEngine
-{
-    /** @cond INTEROP */
-    /** @addtogroup Interop
-     *  @{
-     */
-
-    /// <summary>
-    /// Wrapper around the native SphereCollider class.
-    /// <see cref="SphereCollider"/>
-    /// </summary>
-    internal class NativeSphereCollider : NativeCollider
-    {
-        public NativeSphereCollider()
-        {
-            Internal_CreateInstance(this);
-        }
-
-        public float Radius
-        {
-            get { return Internal_GetRadius(mCachedPtr); }
-            set { Internal_SetRadius(mCachedPtr, value); }
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(NativeSphereCollider instance);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetRadius(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetRadius(IntPtr thisPtr, float radius);
-    }
-
-    /** @} */
-    /** @endcond */
-}

+ 0 - 58
Source/MBansheeEngine/Physics/Interop/NativeSphericalJoint.cs

@@ -1,58 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace BansheeEngine
-{
-    /** @cond INTEROP */
-    /** @addtogroup Interop
-     *  @{
-     */
-
-    /// <summary>
-    /// Wrapper around the native SphericalJoint class.
-    /// <see cref="SphericalJoint"/>
-    /// </summary>
-    internal class NativeSphericalJoint : NativeJoint
-    {
-        public LimitConeRange Limit
-        {
-            set { Internal_SetLimit(mCachedPtr, value); }
-        }
-
-        public bool EnableLimit
-        {
-            set { Internal_SetEnableLimit(mCachedPtr, value); }
-        }
-
-        public NativeSphericalJoint(ScriptCommonJointData commonData, ScriptSphericalJointData data)
-        {
-            Internal_CreateInstance(this, ref commonData, ref data);
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(NativeSphericalJoint instance, 
-            ref ScriptCommonJointData commonData, ref ScriptSphericalJointData data);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetLimit(IntPtr thisPtr, LimitConeRange limit);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetEnableLimit(IntPtr thisPtr, bool enable);
-    }
-
-    /// <summary>
-    /// Used for passing SphericalJoint initialization data between native and managed code.
-    /// </summary>
-    [StructLayout(LayoutKind.Sequential), SerializeObject]
-    internal struct ScriptSphericalJointData // Note: Must match C++ struct ScriptSphericalJointData
-    {
-        public LimitConeRange limit;
-        public bool enableLimit;
-    }
-
-    /** @} */
-    /** @endcond */
-}

+ 0 - 1494
Source/MBansheeEngine/Physics/Joint.cs

@@ -1,1494 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-using System;
-using System.Runtime.InteropServices;
-
-namespace BansheeEngine
-{
-    /** @addtogroup Physics
-     *  @{
-     */
-
-    /// <summary>
-    /// Base class for all Joint types. Joints constrain how two rigidbodies move relative to one another (for example a
-    /// door hinge). One of the bodies in the joint must always be movable (that is non-kinematic).
-    /// </summary>
-    public abstract class Joint : ManagedComponent
-    {
-        internal NativeJoint native;
-
-        [SerializeField]
-        internal SerializableData commonData = new SerializableData();
-
-        /// <summary>
-        /// Triggered when the joint's break force or torque is exceeded.
-        /// </summary>
-        public event Action OnJointBreak;
-
-        /// <summary>
-        /// Maximum force the joint can apply before breaking. Broken joints no longer participate in physics simulation.
-        /// </summary>
-        public float BreakForce
-        {
-            get { return [email protected]; }
-            set
-            {
-                if ([email protected] == value)
-                    return;
-
-                [email protected] = value;
-
-                if (native != null)
-                    native.BreakForce = value;
-            }
-        }
-
-        /// <summary>
-        /// Sets the maximum force the joint can apply before breaking. Broken joints no longer participate in physics
-        /// simulation.
-        /// </summary>
-        public float BreakTorque
-        {
-            get { return [email protected]; }
-            set
-            {
-                if ([email protected] == value)
-                    return;
-
-                [email protected] = value;
-
-                if (native != null)
-                    native.BreakTorque = value;
-            }
-        }
-
-        /// <summary>
-        /// Determines whether collisions between the two bodies managed by the joint are enabled.
-        /// </summary>
-        public bool EnableCollision
-        {
-            get { return [email protected]; }
-            set
-            {
-                if ([email protected] == value)
-                    return;
-
-                [email protected] = value;
-
-                if (native != null)
-                    native.EnableCollision = value;
-            }
-        }
-
-        /// <summary>
-        /// Returns one of the bodies managed by the joint.
-        /// </summary>
-        /// <param name="body">Which of the rigidbodies to return.</param>
-        /// <returns>Rigidbody managed by the joint, or null if none.</returns>
-        public Rigidbody GetRigidbody(JointBody body)
-        {
-            return commonData.bodies[(int) body];
-        }
-
-        /// <summary>
-        /// Sets a body managed by the joint. One of the bodies must be movable (non-kinematic).
-        /// </summary>
-        /// <param name="body">Which of the rigidbodies to set.</param>
-        /// <param name="rigidbody">Rigidbody to managed by the joint, or null. If one of the bodies is null the other
-        ///                         one will be anchored globally to the position/rotation set by <see cref="SetPosition"/>
-        ///                         and <see cref="SetRotation"/>.</param>
-        public void SetRigidbody(JointBody body, Rigidbody rigidbody)
-        {
-            if (commonData.bodies[(int)body] == rigidbody)
-                return;
-
-            if (commonData.bodies[(int)body] != null)
-                commonData.bodies[(int)body].SetJoint(null);
-
-            commonData.bodies[(int)body] = rigidbody;
-
-            if (rigidbody != null)
-                commonData.bodies[(int)body].SetJoint(this);
-
-            // If joint already exists, destroy it if we removed all bodies, otherwise update its transform
-            if (native != null)
-            {
-                if (!IsBodyValid(commonData.bodies[0]) && !IsBodyValid(commonData.bodies[0]))
-                    DestroyNative();
-                else
-                {
-                    native.SetRigidbody(body, rigidbody);
-                    UpdateTransform(body);
-                }
-            }
-            else // If joint doesn't exist, check if we can create it
-            {
-                // Must be an active component and at least one of the bodies must be non-null
-                if (SceneObject.Active && (IsBodyValid(commonData.bodies[0]) || IsBodyValid(commonData.bodies[0])))
-                {
-                    RestoreNative();
-                }
-            }
-        }
-
-        /// <summary>
-        /// Returns the position at which the body is anchored to the joint.
-        /// </summary>
-        /// <param name="body">Which body to retrieve position for.</param>
-        /// <returns>Position relative to the body.</returns>
-        public Vector3 GetPosition(JointBody body)
-        {
-            return commonData.positions[(int)body];
-        }
-
-        /// <summary>
-        /// Sets the position at which the body is anchored to the joint.
-        /// </summary>
-        /// <param name="body">Which body set the position for.</param>
-        /// <param name="position">Position relative to the body.</param>
-        public void SetPosition(JointBody body, Vector3 position)
-        {
-            if (commonData.positions[(int)body] == position)
-                return;
-
-            commonData.positions[(int) body] = position;
-
-            if (native != null)
-                UpdateTransform(body);
-        }
-
-        /// <summary>
-        /// Returns the rotation at which the body is anchored to the joint.
-        /// </summary>
-        /// <param name="body">Which body to retrieve rotation for.</param>
-        /// <returns>Rotation relative to the body.</returns>
-        public Quaternion GetRotation(JointBody body)
-        {
-            return commonData.rotations[(int)body];
-        }
-
-        /// <summary>
-        /// Sets the rotation at which the body is anchored to the joint.
-        /// </summary>
-        /// <param name="body">Which body set the rotation for.</param>
-        /// <param name="rotation">Rotation relative to the body.</param>
-        public void SetRotation(JointBody body, Quaternion rotation)
-        {
-            if (commonData.rotations[(int)body] == rotation)
-                return;
-
-            commonData.rotations[(int)body] = rotation;
-
-            if (native != null)
-                UpdateTransform(body);
-        }
-
-        /// <summary>
-        /// Triggered when the joint breaks.
-        /// </summary>
-        internal void DoOnJointBreak()
-        {
-            if (OnJointBreak != null)
-                OnJointBreak();
-        }
-
-        /// <summary>
-        /// Notifies the joint that one of the attached rigidbodies moved and that its transform needs updating.
-        /// </summary>
-        /// <param name="body">Rigidbody that moved.</param>
-	    internal void NotifyRigidbodyMoved(Rigidbody body)
-	    {
-            if (native == null)
-                return;
-
-		    // If physics update is in progress do nothing, as its the joint itself that's probably moving the body
-		    if (Physics.IsUpdateInProgress)
-			    return;
-
-		    if (commonData.bodies[0] == body)
-			    UpdateTransform(JointBody.Target);
-		    else if (commonData.bodies[1] == body)
-			    UpdateTransform(JointBody.Anchor);
-	    }
-
-        /// <summary>
-        /// Creates the internal representation of the Joint for use by the component.
-        /// </summary>
-        /// <returns>New native joint object.</returns>
-        internal abstract NativeJoint CreateNative();
-
-        private void OnInitialize()
-        {
-            NotifyFlags = TransformChangedFlags.Transform | TransformChangedFlags.Parent;
-        }
-
-        private void OnEnable()
-        {
-            if(IsBodyValid(commonData.bodies[0]) || IsBodyValid(commonData.bodies[1]))
-                RestoreNative();
-        }
-
-        private void OnDisable()
-        {
-            DestroyNative();
-        }
-
-        private void OnDestroy()
-        {
-            if (commonData.bodies[0] != null)
-                commonData.bodies[0].SetJoint(null);
-
-            if (commonData.bodies[1] != null)
-                commonData.bodies[1].SetJoint(null);
-
-            DestroyNative();
-        }
-
-        private void OnTransformChanged(TransformChangedFlags flags)
-        {
-            if (native == null)
-                return;
-
-            // We're ignoring this during physics update because it would cause problems if the joint itself was moved by physics
-            // Note: This isn't particularily correct because if the joint is being moved by physics but the rigidbodies
-            // themselves are not parented to the joint, the transform will need updating. However I'm leaving it up to the
-            // user to ensure rigidbodies are always parented to the joint in such a case (It's an unlikely situation that
-            // I can't think of an use for - joint transform will almost always be set as an initialization step and not a 
-            // physics response).
-            if (Physics.IsUpdateInProgress)
-                return;
-
-            UpdateTransform(JointBody.Target);
-            UpdateTransform(JointBody.Anchor);
-        }
-
-        /// <summary>
-        /// Creates the internal representation of the Joint and restores the values saved by the Component.
-        /// </summary>
-        private void RestoreNative()
-        {
-            // Make sure to always create a new instance of this array, as IntPtrs don't get serialized
-            [email protected] = new []{ IntPtr.Zero, IntPtr.Zero };
-
-            if (commonData.bodies[0] != null)
-            {
-                NativeRigidbody nativeBody = commonData.bodies[0].native;
-                if (nativeBody != null)
-                    [email protected][0] = nativeBody.GetCachedPtr();
-            }
-
-            if (commonData.bodies[1] != null)
-            {
-                NativeRigidbody nativeBody = commonData.bodies[1].native;
-                if (nativeBody != null)
-                    [email protected][1] = nativeBody.GetCachedPtr();
-            }
-
-            GetLocalTransform(JointBody.Target, out [email protected][0], out [email protected][0]);
-            GetLocalTransform(JointBody.Anchor, out [email protected][1], out [email protected][1]);
-
-            native = CreateNative();
-            native.Component = this;
-	    }
-
-        /// <summary>
-        /// Destroys the internal joint representation.
-        /// </summary>
-        private void DestroyNative()
-	    {
-	        if (native != null)
-	        {
-	            native.Destroy();
-                native = null;
-	        }
-	    }
-
-        /// <summary>
-        /// Checks can the provided rigidbody be used for initializing the joint.
-        /// </summary>
-        /// <param name="body">Body to check.</param>
-        /// <returns>True if the body can be used for initializing the joint, false otherwise.</returns>
-        private bool IsBodyValid(Rigidbody body)
-        {
-            if (body == null)
-                return false;
-
-            if (body.native == null)
-                return false;
-
-            return true;
-        }
-
-        /// <summary>
-        /// Calculates the local position/rotation that needs to be applied to the particular joint body.
-        /// </summary>
-        /// <param name="body">Body to calculate the transform for.</param>
-        /// <param name="position">Output position for the body.</param>
-        /// <param name="rotation">Output rotation for the body.</param>
-        protected virtual void GetLocalTransform(JointBody body, out Vector3 position, out Quaternion rotation)
-        {
-            position = commonData.positions[(int)body];
-            rotation = commonData.rotations[(int)body];
-
-            Rigidbody rigidbody = commonData.bodies[(int)body];
-            if (rigidbody == null) // Get world space transform if not relative to any body
-            {
-                Quaternion worldRot = SceneObject.Rotation;
-
-                rotation = worldRot * rotation;
-                position = worldRot.Rotate(position) + SceneObject.Position;
-            }
-            else
-            {
-                position = rotation.Rotate(position);
-            }
-        }
-
-        /// <summary>
-        /// Updates the local transform for the specified body attached to the joint.
-        /// </summary>
-        /// <param name="body">Body to update.</param>
-	    private void UpdateTransform(JointBody body)
-	    {
-		    Vector3 localPos;
-		    Quaternion localRot;
-
-            GetLocalTransform(body, out localPos, out localRot);
-
-            native.SetPosition(body, localPos);
-            native.SetRotation(body, localRot);
-	    }
-
-        /// <summary>
-        /// Holds all data the joint component needs to persist through serialization.
-        /// </summary>
-        [SerializeObject]
-        internal class SerializableData
-        {
-            public ScriptCommonJointData @internal;
-
-            public SerializableData()
-            {
-                @internal.positions = new Vector3[2] { Vector3.Zero, Vector3.Zero };
-                @internal.rotations = new Quaternion[2] { Quaternion.Identity, Quaternion.Identity };
-                @internal.breakForce = float.MaxValue;
-                @internal.breakTorque = float.MaxValue;
-                @internal.enableCollision = false;
-            }
-
-            public Rigidbody[] bodies = new Rigidbody[2];
-            public Vector3[] positions = new Vector3[2] { Vector3.Zero, Vector3.Zero };
-            public Quaternion[] rotations = new Quaternion[2] { Quaternion.Identity, Quaternion.Identity };
-        }
-    }
-
-    /// <summary>
-    /// Controls spring parameters for a physics joint limits. If a limit is soft (body bounces back due to restitution when 
-    /// the limit is reached) the spring will pull the body back towards the limit using the specified parameters.
-    /// </summary>
-    [StructLayout(LayoutKind.Sequential), SerializeObject]
-    public struct Spring // Note: Must match C++ struct Spring
-    {
-        /// <summary>
-        /// Constructs a spring.
-        /// </summary>
-        /// <param name="stiffness">Spring strength.Force proportional to the position error.</param>
-        /// <param name="damping">Damping strength. Force propertional to the velocity error.</param>
-        public Spring(float stiffness, float damping)
-        {
-            this.stiffness = stiffness;
-            this.damping = damping;
-        }
-
-        /// <inheritdoc/>
-        public override bool Equals(object rhs)
-        {
-            if (rhs is Spring)
-            {
-                Spring other = (Spring)rhs;
-                return stiffness == other.stiffness && damping == other.damping;
-            }
-
-            return false;
-        }
-
-        /// <inheritdoc/>
-        public override int GetHashCode()
-        {
-            return base.GetHashCode();
-        }
-
-        public static bool operator ==(Spring a, Spring b)
-        {
-            return a.Equals(b);
-        }
-
-        public static bool operator !=(Spring a, Spring b)
-        {
-            return !(a == b);
-        }
-
-        /// <summary>
-        /// Spring strength. Force proportional to the position error.
-        /// </summary>
-        public float stiffness;
-
-        /// <summary>
-        /// Damping strength. Force propertional to the velocity error.
-        /// </summary>
-        public float damping;
-	}
-
-    /// <summary>
-    /// Specifies first or second body referenced by a Joint.
-    /// </summary>
-    public enum JointBody
-    {
-        /// <summary>
-        /// Body the joint is influencing.
-        /// </summary>
-        Target,
-        /// <summary>
-        /// Body to which the joint is attached to (if any).
-        /// </summary>
-        Anchor
-    };
-
-    /// <summary>
-    /// Specifies axes that the D6 joint can constrain motion on.
-    /// </summary>
-    public enum D6JointAxis
-    {
-        /// <summary>
-        /// Movement on the X axis. 
-        /// </summary>
-        X,
-        /// <summary>
-        /// Movement on the Y axis.
-        /// </summary>
-		Y,
-        /// <summary>
-        /// Movement on the Z axis.
-        /// </summary>
-		Z,
-        /// <summary>
-        /// Rotation around the X axis.
-        /// </summary>
-		Twist,
-        /// <summary>
-        /// Rotation around the Y axis.
-        /// </summary>
-        SwingY,
-        /// <summary>
-        /// Rotation around the Z axis.
-        /// </summary>
-        SwingZ,
-		Count
-    }
-
-    /// <summary>
-    /// Specifies type of constraint placed on a specific axis of a D6 joint.
-    /// </summary>
-    public enum D6JointMotion
-    {
-        /// <summary>
-        /// Axis is immovable.
-        /// </summary>
-        Locked,
-        /// <summary>
-        /// Axis will be constrained by the specified limits.
-        /// </summary>
-        Limited,
-        /// <summary>
-        /// Axis will not be constrained.
-        /// </summary>
-        Free,
-		Count
-    }
-
-    /// <summary>
-    /// Type of drives that can be used for moving or rotating bodies attached to the D6 joint.
-    /// </summary>
-    public enum D6JointDriveType
-    {
-        /// <summary>
-        /// Linear movement on the X axis using the linear drive model.
-        /// </summary>
-        X,
-        /// <summary>
-        /// Linear movement on the Y axis using the linear drive model.
-        /// </summary>
-        Y,
-        /// <summary>
-        /// Linear movement on the Z axis using the linear drive model.
-        /// </summary>
-        Z,
-        /// <summary>
-        /// Rotation around the Y axis using the twist/swing angular drive model. Should not be used together with 
-        /// SLERP mode. 
-        /// </summary>
-		Swing, 
-        /// <summary>
-        /// Rotation around the Z axis using the twist/swing angular drive model. Should not be used together with 
-        /// SLERP mode.
-        /// </summary>
-		Twist,
-        /// <summary>
-        /// Rotation using spherical linear interpolation. Uses the SLERP angular drive mode which performs rotation
-        /// by interpolating the quaternion values directly over the shortest path (applies to all three axes, which
-        /// they all must be unlocked).
-        /// </summary>
-		SLERP, 
-		Count
-    }
-
-    /// <summary>
-    /// Specifies parameters for a drive that will attempt to move the D6 joint bodies to the specified drive position and
-    /// velocity.
-    /// </summary>
-    [SerializeObject]
-    public class D6JointDrive
-    {
-        [SerializeField]
-        private D6JointDriveData data;
-
-        /// <summary>
-        /// Spring strength. Force proportional to the position error.
-        /// </summary>
-        public float Stiffness { get { return data.stiffness; } }
-
-        /// <summary>
-        /// Damping strength. Force propertional to the velocity error.
-        /// </summary>
-        public float Damping { get { return data.damping; } }
-
-        /// <summary>
-        /// Maximum force the drive can apply.
-        /// </summary>
-        public float ForceLimit { get { return data.forceLimit; } }
-
-        /// <summary>
-        /// If true the drive will generate acceleration instead of forces. Acceleration drives are easier to tune as
-        /// they account for the masses of the actors to which the joint is attached.
-        /// </summary>
-        public bool Acceleration { get { return data.acceleration; } }
-
-        /// <summary>
-        /// Gets drive properties.
-        /// </summary>
-        public D6JointDriveData Data
-        {
-            get { return data; }
-        }
-
-        /// <summary>
-        /// Constructor for deserialization only.
-        /// </summary>
-        private D6JointDrive()
-        { }
-
-        /// <summary>
-        /// Constructs a new D6 joint drive.
-        /// </summary>
-        /// <param name="stiffness"><see cref="Stiffness"/></param>
-        /// <param name="damping"><see cref="Damping"/></param>
-        /// <param name="forceLimit"><see cref="ForceLimit"/></param>
-        /// <param name="acceleration"><see cref="Acceleration"/></param>
-        public D6JointDrive(float stiffness = 0.0f, float damping = 0.0f, float forceLimit = float.MaxValue,
-            bool acceleration = false)
-        {
-            data.stiffness = stiffness;
-            data.damping = damping;
-            data.forceLimit = forceLimit;
-            data.acceleration = acceleration;
-        }
-
-        /// <summary>
-        /// Constructs a new D6 joint drive.
-        /// </summary>
-        /// <param name="data">Properties to initialize the drive with.</param>
-        public D6JointDrive(D6JointDriveData data)
-        {
-            this.data = data;
-        }
-
-        /// <inheritdoc/>
-        public override bool Equals(object rhs)
-        {
-            if (rhs is D6JointDrive)
-            {
-                D6JointDrive other = (D6JointDrive)rhs;
-                return Stiffness == other.Stiffness && Damping == other.Damping && ForceLimit == other.ForceLimit 
-                    && Acceleration == other.Acceleration;
-            }
-
-            return false;
-        }
-
-        /// <inheritdoc/>
-        public override int GetHashCode()
-        {
-            return base.GetHashCode();
-        }
-
-        public static bool operator ==(D6JointDrive a, D6JointDrive b)
-        {
-            return a.Equals(b);
-        }
-
-        public static bool operator !=(D6JointDrive a, D6JointDrive b)
-        {
-            return !(a == b);
-        }
-
-        /// <summary>
-        /// Used for accessing drive data from native code.
-        /// </summary>
-        /// <returns>Native readable drive structure.</returns>
-        private D6JointDriveData Internal_GetNative()
-        {
-            return data;
-        }
-    }
-
-    /// <summary>
-    /// Properties of a drive that drives the hinge joint's angular velocity towards a paricular value.
-    /// </summary>
-    [SerializeObject]
-    public class HingeJointDrive
-    {
-        [SerializeField]
-        private HingeJointDriveData data;
-
-        /// <summary>
-        /// Target speed of the joint.
-        /// </summary>
-        public float Speed { get { return data.speed; } }
-
-        /// <summary>
-        /// Maximum torque the drive is allowed to apply.
-        /// </summary>
-        public float ForceLimit { get { return data.forceLimit; } }
-
-        /// <summary>
-        /// Scales the velocity of the first body, and its response to drive torque is scaled down.
-        /// </summary>
-        public float GearRatio { get { return data.gearRatio; } }
-
-        /// <summary>
-        /// If the joint is moving faster than the drive's target speed, the drive will try to break. If you don't want
-        /// the breaking to happen set this to true.
-        /// </summary>
-        public bool FreeSpin { get { return data.freeSpin; } }
-
-        /// <summary>
-        /// Gets drive properties.
-        /// </summary>
-        public HingeJointDriveData Data
-        {
-            get { return data; }
-        }
-
-        /// <summary>
-        /// Constructor for deserialization only.
-        /// </summary>
-        private HingeJointDrive()
-        { }
-
-        /// <summary>
-        /// Constructs a new hinge joint drive.
-        /// </summary>
-        /// <param name="speed"><see cref="Speed"/></param>
-        /// <param name="forceLimit"><see cref="ForceLimit"/></param>
-        /// <param name="gearRatio"><see cref="GearRatio"/></param>
-        /// <param name="freeSpin"><see cref="FreeSpin"/></param>
-        public HingeJointDrive(float speed = 0.0f, float forceLimit = float.MaxValue, 
-            float gearRatio = 1.0f, bool freeSpin = false)
-        {
-            data.speed = speed;
-            data.forceLimit = forceLimit;
-            data.gearRatio = gearRatio;
-            data.freeSpin = freeSpin;
-        }
-
-        /// <summary>
-        /// Constructs a new hinge joint drive.
-        /// </summary>
-        /// <param name="data">Properties to initialize the drive with.</param>
-        public HingeJointDrive(HingeJointDriveData data)
-        {
-            this.data = data;
-        }
-
-        /// <inheritdoc/>
-        public override bool Equals(object rhs)
-        {
-            if (rhs is HingeJointDrive)
-            {
-                HingeJointDrive other = (HingeJointDrive)rhs;
-                return data.speed == other.data.speed && data.gearRatio == other.data.gearRatio && 
-                    data.forceLimit == other.data.forceLimit && data.freeSpin == other.data.freeSpin;
-            }
-
-            return false;
-        }
-
-        /// <inheritdoc/>
-        public override int GetHashCode()
-        {
-            return base.GetHashCode();
-        }
-
-        public static bool operator ==(HingeJointDrive a, HingeJointDrive b)
-        {
-            return a.Equals(b);
-        }
-
-        public static bool operator !=(HingeJointDrive a, HingeJointDrive b)
-        {
-            return !(a == b);
-        }
-
-        /// <summary>
-        /// Used for accessing drive data from native code.
-        /// </summary>
-        /// <returns>Native readable drive structure.</returns>
-        private HingeJointDriveData Internal_GetNative()
-        {
-            return data;
-        }
-    };
-
-    /// <summary>
-    /// Contains common values used by all Joint limit types.
-    /// </summary>
-    [SerializeObject]
-    public class LimitCommon
-    {
-        [SerializeField]
-        private LimitCommonData data;
-
-        /// <summary>
-        /// Distance from the limit at which it becomes active. Allows the solver to activate earlier than the limit is
-        /// reached to avoid breaking the limit.
-        /// </summary>
-        public float ContactDist { get { return data.contactDist; } }
-
-        /// <summary>
-        /// Controls how do objects react when the limit is reached, values closer to zero specify non-ellastic collision,
-        /// while those closer to one specify more ellastic(i.e bouncy) collision.Must be in [0, 1] range.
-        /// </summary>
-		public float Restitution { get { return data.restitution; } }
-
-        /// <summary>
-        /// Spring that controls how are the bodies pulled back towards the limit when they breach it.
-        /// </summary>
-        public Spring Spring { get { return data.spring; } }
-
-        /// <summary>
-        /// Gets properties common to all limit types.
-        /// </summary>
-        public LimitCommonData CommonData
-        {
-            get { return data; }
-        }
-
-        protected LimitCommon(float contactDist = -1.0f)
-        {
-            data.contactDist = contactDist;
-            data.restitution = 0.0f;
-            data.spring = new Spring();
-        }
-
-        protected LimitCommon(Spring spring, float restitution = 0.0f)
-        {
-            data.contactDist = -1.0f;
-            data.restitution = restitution;
-            data.spring = spring;
-        }
-
-        protected LimitCommon(LimitCommonData data)
-        {
-            this.data = data;
-        }
-
-        /// <inheritdoc/>
-        public override bool Equals(object rhs)
-        {
-            if (rhs is LimitCommon)
-            {
-                LimitCommon other = (LimitCommon)rhs;
-                return ContactDist == other.ContactDist && Restitution == other.Restitution && Spring == other.Spring;
-            }
-
-            return false;
-        }
-
-        /// <inheritdoc/>
-        public override int GetHashCode()
-        {
-            return base.GetHashCode();
-        }
-
-        public static bool operator ==(LimitCommon a, LimitCommon b)
-        {
-            return a.Equals(b);
-        }
-
-        public static bool operator !=(LimitCommon a, LimitCommon b)
-        {
-            return !(a == b);
-        }
-    }
-
-    /// <summary>
-    /// Represents a joint limit between two distance values. Lower value must be less than the upper value.
-    /// </summary>
-    [SerializeObject]
-    public class LimitLinearRange : LimitCommon
-    {
-        [SerializeField]
-        private LimitLinearRangeData data;
-
-        /// <summary>
-        /// Lower distance of the limit. Must be less than <see cref="Upper"/>.
-        /// </summary>
-        public float Lower { get { return data.lower; } }
-
-        /// <summary>
-        /// Upper distance of the limit. Must be greater than <see cref="Lower"/>.
-        /// </summary>
-        public float Upper { get { return data.upper; } }
-
-        /// <summary>
-        /// Gets properties of the linear limit range.
-        /// </summary>
-        public LimitLinearRangeData Data
-        {
-            get { return data; }
-        }
-
-        /// <summary>
-        /// Constructs an empty limit.
-        /// </summary>
-        public LimitLinearRange()
-        { }
-
-        /// <summary>
-        /// Constructs a hard limit. Once the limit is reached the movement of the attached bodies will come to a stop.
-        /// </summary>
-        /// <param name="lower"><see cref="Lower"/></param>
-        /// <param name="upper"><see cref="Upper"/></param>
-        /// <param name="contactDist"><see cref="LimitCommon.ContactDist"/></param>
-        public LimitLinearRange(float lower, float upper, float contactDist = -1.0f)
-            :base(contactDist)
-        {
-            data.lower = lower;
-            data.upper = upper;
-        }
-
-        /// <summary>
-        /// Constructs a soft limit. Once the limit is reached the bodies will bounce back according to the resitution
-        /// parameter and will be pulled back towards the limit by the provided spring.
-        /// </summary>
-        /// <param name="lower"><see cref="Lower"/></param>
-        /// <param name="upper"><see cref="Upper"/></param>
-        /// <param name="spring"><see cref="LimitCommon.Spring"/></param>
-        /// <param name="restitution"><see cref="LimitCommon.Restitution"/></param>
-        public LimitLinearRange(float lower, float upper, Spring spring, float restitution = 0.0f)
-            :base(spring, restitution)
-        {
-            data.lower = lower;
-            data.upper = upper;
-        }
-
-        /// <summary>
-        /// Constructs a new limit from the provided properties.
-        /// </summary>
-        /// <param name="limitData">Linear range specific properties.</param>
-        /// <param name="commonData">Properties common to all limit types.</param>
-        public LimitLinearRange(LimitLinearRangeData limitData, LimitCommonData commonData)
-            :base(commonData)
-        {
-            this.data = limitData;
-        }
-
-        /// <inheritdoc/>
-        public override bool Equals(object rhs)
-        {
-            if (rhs is LimitLinearRange)
-            {
-                LimitLinearRange other = (LimitLinearRange)rhs;
-                return base.Equals(rhs) && Lower == other.Lower && Upper == other.Upper;
-            }
-
-            return false;
-        }
-
-        /// <inheritdoc/>
-        public override int GetHashCode()
-        {
-            return base.GetHashCode();
-        }
-
-        public static bool operator ==(LimitLinearRange a, LimitLinearRange b)
-        {
-            return a.Equals(b);
-        }
-
-        public static bool operator !=(LimitLinearRange a, LimitLinearRange b)
-        {
-            return !(a == b);
-        }
-
-        /// <summary>
-        /// Used for accessing limit data from native code.
-        /// </summary>
-        /// <returns>Native readable limit structure.</returns>
-        private ScriptLimitLinearRange Internal_GetNative()
-        {
-            ScriptLimitLinearRange output;
-
-            output.contactDist = ContactDist;
-            output.restitution = Restitution;
-            output.spring = Spring;
-            output.lower = Lower;
-            output.upper = Upper;
-
-            return output;
-        }
-    }
-
-    /// <summary>
-    /// Represents a joint limit between zero a single distance value.
-    /// </summary>
-    [SerializeObject]
-    public class LimitLinear : LimitCommon
-    {
-        [SerializeField]
-        private LimitLinearData data;
-
-        /// <summary>
-        /// Distance at which the limit becomes active.
-        /// </summary>
-        public float Extent { get { return data.extent; } }
-
-        /// <summary>
-        /// Gets properties of the linear limit.
-        /// </summary>
-        public LimitLinearData Data
-        {
-            get { return data; }
-        }
-
-        /// <summary>
-        /// Constructs an empty limit.
-        /// </summary>
-        public LimitLinear()
-		{ }
-
-        /// <summary>
-        /// Constructs a hard limit.Once the limit is reached the movement of the attached bodies will come to a stop.
-        /// </summary>
-        /// <param name="extent"><see cref="Extent"/></param>
-        /// <param name="contactDist"><see cref="LimitCommon.ContactDist"/></param>
-        public LimitLinear(float extent, float contactDist = -1.0f)
-			:base(contactDist)
-        {
-            data.extent = extent;
-        }
-
-        /// <summary>
-        /// Constructs a soft limit.Once the limit is reached the bodies will bounce back according to the resitution
-        /// parameter and will be pulled back towards the limit by the provided spring.
-        /// </summary>
-        /// <param name="extent"><see cref="Extent"/></param>
-        /// <param name="spring"><see cref="LimitCommon.Spring"/></param>
-        /// <param name="restitution"><see cref="LimitCommon.Restitution"/></param>
-		public LimitLinear(float extent, Spring spring, float restitution = 0.0f)
-			:base(spring, restitution)
-        {
-            data.extent = extent;
-        }
-
-        /// <summary>
-        /// Constructs a new limit from the provided properties.
-        /// </summary>
-        /// <param name="limitData">Linear limit specific properties.</param>
-        /// <param name="commonData">Properties common to all limit types.</param>
-        public LimitLinear(LimitLinearData limitData, LimitCommonData commonData)
-            :base(commonData)
-        {
-            this.data = limitData;
-        }
-
-        /// <inheritdoc/>
-        public override bool Equals(object rhs)
-        {
-            if (rhs is LimitLinear)
-            {
-                LimitLinear other = (LimitLinear)rhs;
-                return base.Equals(rhs) && Extent == other.Extent;
-            }
-
-            return false;
-        }
-
-        /// <inheritdoc/>
-        public override int GetHashCode()
-        {
-            return base.GetHashCode();
-        }
-
-        public static bool operator ==(LimitLinear a, LimitLinear b)
-        {
-            return a.Equals(b);
-        }
-
-        public static bool operator !=(LimitLinear a, LimitLinear b)
-        {
-            return !(a == b);
-        }
-
-        /// <summary>
-        /// Used for accessing limit data from native code.
-        /// </summary>
-        /// <returns>Native readable limit structure.</returns>
-        private ScriptLimitLinear Internal_GetNative()
-        {
-            ScriptLimitLinear output;
-            output.contactDist = ContactDist;
-            output.restitution = Restitution;
-            output.spring = Spring;
-            output.extent = Extent;
-
-            return output;
-        }
-    }
-
-    /// <summary>
-    /// Represents a joint limit between two angles.
-    /// </summary>
-    [SerializeObject]
-    public class LimitAngularRange : LimitCommon
-	{
-        [SerializeField]
-        private LimitAngularRangeData data;
-
-        /// <summary>
-        /// Lower angle of the limit. Must be less than <see cref="Upper"/>.
-        /// </summary>
-        public Radian Lower { get { return data.lower; } }
-
-        /// <summary>
-        /// Upper angle of the limit. Must be greater than <see cref="Lower"/>.
-        /// </summary>
-        public Radian Upper { get { return data.upper; } }
-
-        /// <summary>
-        /// Gets properties of the angular limit range.
-        /// </summary>
-        public LimitAngularRangeData Data
-        {
-            get { return data; }
-        }
-
-        /// <summary>
-        /// Constructs an empty limit.
-        /// </summary>
-        public LimitAngularRange()
-		{ }
-
-        /// <summary>
-        /// Constructs a hard limit. Once the limit is reached the movement of the attached bodies will come to a stop.
-        /// </summary>
-        /// <param name="lower"><see cref="Lower"/></param>
-        /// <param name="upper"><see cref="Upper"/></param>
-        /// <param name="contactDist"><see cref="LimitCommon.ContactDist"/></param>
-        public LimitAngularRange(Radian lower, Radian upper, float contactDist = -1.0f)
-            : base(contactDist)
-        {
-            data.lower = lower;
-            data.upper = upper;
-        }
-
-        /// <summary>
-        /// Constructs a soft limit. Once the limit is reached the bodies will bounce back according to the resitution
-        /// parameter and will be pulled back towards the limit by the provided spring.
-        /// </summary>
-        /// <param name="lower"><see cref="Lower"/></param>
-        /// <param name="upper"><see cref="Upper"/></param>
-        /// <param name="spring"><see cref="LimitCommon.Spring"/></param>
-        /// <param name="restitution"><see cref="LimitCommon.Restitution"/></param>
-        public LimitAngularRange(Radian lower, Radian upper, Spring spring, float restitution = 0.0f)
-            : base(spring, restitution)
-        {
-            data.lower = lower;
-            data.upper = upper;
-        }
-
-        /// <summary>
-        /// Constructs a new limit from the provided properties.
-        /// </summary>
-        /// <param name="limitData">Angular limit range specific properties.</param>
-        /// <param name="commonData">Properties common to all limit types.</param>
-        public LimitAngularRange(LimitAngularRangeData limitData, LimitCommonData commonData)
-            :base(commonData)
-        {
-            this.data = limitData;
-        }
-
-        /// <inheritdoc/>
-        public override bool Equals(object rhs)
-        {
-            if (rhs is LimitAngularRange)
-            {
-                LimitAngularRange other = (LimitAngularRange)rhs;
-                return base.Equals(rhs) && Lower == other.Lower && Upper == other.Upper;
-            }
-
-            return false;
-        }
-
-        /// <inheritdoc/>
-        public override int GetHashCode()
-        {
-            return base.GetHashCode();
-        }
-
-        public static bool operator ==(LimitAngularRange a, LimitAngularRange b)
-        {
-            return a.Equals(b);
-        }
-
-        public static bool operator !=(LimitAngularRange a, LimitAngularRange b)
-        {
-            return !(a == b);
-        }
-
-        /// <summary>
-        /// Used for accessing limit data from native code.
-        /// </summary>
-        /// <returns>Native readable limit structure.</returns>
-        private ScriptLimitAngularRange Internal_GetNative()
-        {
-            ScriptLimitAngularRange output;
-            output.contactDist = ContactDist;
-            output.restitution = Restitution;
-            output.spring = Spring;
-            output.lower = Lower;
-            output.upper = Upper;
-
-            return output;
-        }
-    }
-
-    /// <summary>
-    /// Represents a joint limit that contraints movement to within an elliptical cone.
-    /// </summary>
-    [SerializeObject]
-    public class LimitConeRange : LimitCommon
-    {
-        [SerializeField]
-        private LimitConeRangeData data;
-
-        /// <summary>
-        /// Y angle of the cone. Movement is constrainted between 0 and this angle on the Y axis.
-        /// </summary>
-        public Radian YLimitAngle { get { return data.yLimitAngle; } }
-
-        /// <summary>
-        /// Z angle of the cone. Movement is constrainted between 0 and this angle on the Z axis.
-        /// </summary>
-        public Radian ZLimitAngle { get { return data.zLimitAngle; } }
-
-        /// <summary>
-        /// Gets properties of the cone limit range.
-        /// </summary>
-        public LimitConeRangeData Data
-        {
-            get { return data; }
-        }
-
-        /// <summary>
-        /// Constructs a limit with a 45 degree cone.
-        /// </summary>
-        public LimitConeRange()
-        {
-            data.yLimitAngle = new Radian(MathEx.Pi * 0.5f);
-            data.zLimitAngle = new Radian(MathEx.Pi * 0.5f);
-        }
-
-        /// <summary>
-        /// Constructs a hard limit. Once the limit is reached the movement of the attached bodies will come to a stop.
-        /// </summary>
-        /// <param name="yLimitAngle"><see cref="YLimitAngle"/></param>
-        /// <param name="zLimitAngle"><see cref="ZLimitAngle"/></param>
-        /// <param name="contactDist"><see cref="LimitCommon.ContactDist"/></param>
-        public LimitConeRange(Radian yLimitAngle, Radian zLimitAngle, float contactDist = -1.0f)
-            : base(contactDist)
-        {
-            data.yLimitAngle = yLimitAngle;
-            data.zLimitAngle = zLimitAngle;
-        }
-
-        /// <summary>
-        /// Constructs a soft limit. Once the limit is reached the bodies will bounce back according to the resitution
-        /// parameter and will be pulled back towards the limit by the provided spring.
-        /// </summary>
-        /// <param name="yLimitAngle"><see cref="YLimitAngle"/></param>
-        /// <param name="zLimitAngle"><see cref="ZLimitAngle"/></param>
-        /// <param name="spring"><see cref="LimitCommon.Spring"/></param>
-        /// <param name="restitution"><see cref="LimitCommon.Restitution"/></param>
-        public LimitConeRange(Radian yLimitAngle, Radian zLimitAngle, Spring spring, float restitution = 0.0f)
-            : base(spring, restitution)
-        {
-            data.yLimitAngle = yLimitAngle;
-            data.zLimitAngle = zLimitAngle;
-        }
-
-        /// <summary>
-        /// Constructs a new limit from the provided properties.
-        /// </summary>
-        /// <param name="limitData">Cone limit range specific properties.</param>
-        /// <param name="commonData">Properties common to all limit types.</param>
-        public LimitConeRange(LimitConeRangeData limitData, LimitCommonData commonData)
-            :base(commonData)
-        {
-            this.data = limitData;
-        }
-
-        /// <inheritdoc/>
-        public override bool Equals(object rhs)
-        {
-            if (rhs is LimitConeRange)
-            {
-                LimitConeRange other = (LimitConeRange)rhs;
-                return base.Equals(rhs) && YLimitAngle == other.YLimitAngle && ZLimitAngle == other.ZLimitAngle;
-            }
-
-            return false;
-        }
-
-        /// <inheritdoc/>
-        public override int GetHashCode()
-        {
-            return base.GetHashCode();
-        }
-
-        public static bool operator ==(LimitConeRange a, LimitConeRange b)
-        {
-            return a.Equals(b);
-        }
-
-        public static bool operator !=(LimitConeRange a, LimitConeRange b)
-        {
-            return !(a == b);
-        }
-
-        /// <summary>
-        /// Used for accessing limit data from native code.
-        /// </summary>
-        /// <returns>Native readable limit structure.</returns>
-        private ScriptLimitConeRange Internal_GetNative()
-        {
-            ScriptLimitConeRange output;
-            output.contactDist = ContactDist;
-            output.restitution = Restitution;
-            output.spring = Spring;
-            output.yLimitAngle = YLimitAngle;
-            output.zLimitAngle = ZLimitAngle;
-
-            return output;
-        }
-	}
-
-    /// <summary>
-    /// Contains data used by HingeJointDrive.
-    /// </summary>
-    [StructLayout(LayoutKind.Sequential), SerializeObject]
-    public struct HingeJointDriveData // Note: Must match C++ struct HingeJoint::Drive
-    {
-        /// <summary>
-        /// <see cref="HingeJointDrive.Speed"/>
-        /// </summary>
-        public float speed;
-
-        /// <summary>
-        /// <see cref="HingeJointDrive.ForceLimit"/>
-        /// </summary>
-        public float forceLimit;
-
-        /// <summary>
-        /// <see cref="HingeJointDrive.GearRatio"/>
-        /// </summary>
-        public float gearRatio;
-
-        /// <summary>
-        /// <see cref="HingeJointDrive.FreeSpin"/>
-        /// </summary>
-        public bool freeSpin;
-    }
-
-    /// <summary>
-    /// Contains data used by D6JointDrive.
-    /// </summary>
-    [StructLayout(LayoutKind.Sequential), SerializeObject]
-    public struct D6JointDriveData // Note: Must match C++ struct D6Joint::Drive
-    {
-        /// <summary>
-        /// <see cref="D6JointDrive.Stiffness"/>
-        /// </summary>
-        public float stiffness;
-
-        /// <summary>
-        /// <see cref="D6JointDrive.Damping"/>
-        /// </summary>
-        public float damping;
-
-        /// <summary>
-        /// <see cref="D6JointDrive.ForceLimit"/>
-        /// </summary>
-        public float forceLimit;
-
-        /// <summary>
-        /// <see cref="D6JointDrive.Acceleration"/>
-        /// </summary>
-        public bool acceleration;
-    }
-
-    /// <summary>
-    /// Contains data used by LimitCommon.
-    /// </summary>
-    [SerializeObject]
-    public struct LimitCommonData
-    {
-        /// <summary>
-        /// <see cref="LimitCommon.ContactDist"/>
-        /// </summary>
-        public float contactDist;
-
-        /// <summary>
-        /// <see cref="LimitCommon.Restitution"/>
-        /// </summary>
-        public float restitution;
-
-        /// <summary>
-        /// <see cref="LimitCommon.Spring"/>
-        /// </summary>
-        public Spring spring;
-    }
-
-    /// <summary>
-    /// Contains data used by LimitLinearRange.
-    /// </summary>
-    [SerializeObject]
-    public struct LimitLinearRangeData
-    {
-        /// <summary>
-        /// <see cref="LimitLinearRange.Lower"/>
-        /// </summary>
-        public float lower;
-        /// <summary>
-        /// <see cref="LimitLinearRange.Upper"/>
-        /// </summary>
-        public float upper;
-    }
-
-    /// <summary>
-    /// Contains data used by LimitLinear.
-    /// </summary>
-    [SerializeObject]
-    public struct LimitLinearData
-    {
-        /// <summary>
-        /// <see cref="LimitLinearRange.Extent"/>
-        /// </summary>
-        public float extent;
-    }
-
-    /// <summary>
-    /// Contains data used by LimitAngularRange.
-    /// </summary>
-    [SerializeObject]
-    public struct LimitAngularRangeData
-    {
-        /// <summary>
-        /// <see cref="LimitAngularRange.Lower"/>
-        /// </summary>
-        public Radian lower;
-        /// <summary>
-        /// <see cref="LimitAngularRange.Upper"/>
-        /// </summary>
-        public Radian upper;
-    }
-
-    /// <summary>
-    /// Contains data used by LimitConeRange.
-    /// </summary>
-    [SerializeObject]
-    public struct LimitConeRangeData
-    {
-        /// <summary>
-        /// <see cref="LimitConeRange.YLimitAngle"/>
-        /// </summary>
-        public Radian yLimitAngle;
-        /// <summary>
-        /// <see cref="LimitConeRange.ZLimitAngle"/>
-        /// </summary>
-        public Radian zLimitAngle;
-    }
-
-    /// <summary>
-    /// Used for passing LimitLinearRange data between native and managed code.
-    /// </summary>
-    [StructLayout(LayoutKind.Sequential)]
-    internal struct ScriptLimitLinearRange // Note: Must match C++ struct LimitLinearRange
-    {
-        public float contactDist;
-        public float restitution;
-        public Spring spring;
-        public float lower;
-        public float upper;
-    }
-
-    /// <summary>
-    /// Used for passing LimitLinear data between native and managed code.
-    /// </summary>
-    [StructLayout(LayoutKind.Sequential)]
-    internal struct ScriptLimitLinear // Note: Must match C++ struct LimitLinear
-    {
-        public float contactDist;
-        public float restitution;
-        public Spring spring;
-        public float extent;
-    }
-
-    /// <summary>
-    /// Used for passing LimitAngularRange data between native and managed code.
-    /// </summary>
-    [StructLayout(LayoutKind.Sequential)]
-    internal struct ScriptLimitAngularRange // Note: Must match C++ struct LimitAngularRange
-    {
-        public float contactDist;
-        public float restitution;
-        public Spring spring;
-        public Radian lower;
-        public Radian upper;
-    }
-
-    /// <summary>
-    /// Used for passing LimitConeRange data between native and managed code.
-    /// </summary>
-    [StructLayout(LayoutKind.Sequential)]
-    internal struct ScriptLimitConeRange // Note: Must match C++ struct LimitConeRange
-    {
-        public float contactDist;
-        public float restitution;
-        public Spring spring;
-        public Radian yLimitAngle;
-        public Radian zLimitAngle;
-    }
-
-    /** @} */
-}

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません