Просмотр исходного кода

PhysicsMesh & PhysicsMaterial now exported using the script binding generator

BearishSun 8 лет назад
Родитель
Сommit
8b18fd5ca2

+ 3 - 3
Source/BansheeCore/Include/BsCommonTypes.h

@@ -496,15 +496,15 @@ namespace bs
 	};
 
 	/** Valid types of a mesh used for physics. */
-	enum class PhysicsMeshType
+	enum class BS_SCRIPT_EXPORT() PhysicsMeshType
 	{
 		/** 
 		 * A regular triangle mesh. Mesh can be of arbitrary size but cannot be used for triggers and non-kinematic 
-         * objects. Occurs a significantly larger performance impact than convex meshes.
+		 * objects. Incurrs a significantly larger performance impact than convex meshes.
 		 */
 		Triangle,
 		/** 
-		 * Mesh representing a convex shape. Mesh will not have more than 256 vertices. Occurs a significantly lower
+		 * Mesh representing a convex shape. Mesh will not have more than 256 vertices. Incurrs a significantly lower
 		 * performance impact than triangle meshes.
 		 */
 		Convex

+ 21 - 12
Source/BansheeCore/Include/BsPhysicsMaterial.h

@@ -11,38 +11,46 @@ namespace bs
 	 *  @{
 	 */
 
-	/** Physics material that controls how objects react when they collide. */
-	class BS_CORE_EXPORT PhysicsMaterial : public Resource
+	/**
+	 * Material that controls how two physical objects interact with each other. Materials of both objects are used during
+	 * their interaction and their combined values are used.
+	 */
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics) PhysicsMaterial : public Resource
 	{
 	public:
 		virtual ~PhysicsMaterial() { }
 
 		/** 
-		  * Sets static friction of the material. Controls friction when two in-contact objects are not moving lateral to
-		  * each other (for example how difficult is to get an object moving from a static state while it is in contact 
-		  * other object(s)).
+		  * Controls friction when two in-contact objects are not moving lateral to each other (for example how difficult 
+		  * it is to get an object moving from a static state while it is in contact with other object(s)).
 		  */
+		BS_SCRIPT_EXPORT(n:StaticFriction,pr:setter)
 		virtual void setStaticFriction(float value) = 0;
 
-		/** Gets static friction of the material. */
+		/** @copydoc setStaticFriction() */
+		BS_SCRIPT_EXPORT(n:StaticFriction,pr:getter)
 		virtual float getStaticFriction() const = 0;
 
 		/**
-		 * Sets dynamic friction of the material. Controls friction when two in-contact objects are moving lateral to each
-		 * other (for example how quickly does an object slow down when sliding along another object).
+		 * Controls friction when two in-contact objects are moving lateral to each other (for example how quickly does an
+		 * object slow down when sliding along another object).
 		 */
+		BS_SCRIPT_EXPORT(n:DynamicFriction,pr:setter)
 		virtual void setDynamicFriction(float value) = 0;
 
-		/** Gets dynamic friction of the material .*/
+		/** @copydoc setDynamicFriction() */
+		BS_SCRIPT_EXPORT(n:DynamicFriction,pr:getter)
 		virtual float getDynamicFriction() const = 0;
 
 		/** 
-		 * Sets restitution coefficient of the material. Controls "bounciness" of an object during a collision. Value of 1
-		 * means the collision is elastic, and value of 0 means the value is inelastic. Must be in [0, 1] range.
+		 * Controls "bounciness" of an object during a collision. Value of 1 means the collision is elastic, and value of 0 
+		 * means the value is inelastic. Must be in [0, 1] range.
 		 */
+		BS_SCRIPT_EXPORT(n:Restitution,pr:setter)
 		virtual void setRestitutionCoefficient(float value) = 0;
 
-		/** Gets restitution coefficient of the material. */
+		/** @copydoc setRestitutionCoefficient() */
+		BS_SCRIPT_EXPORT(n:Restitution,pr:getter)
 		virtual float getRestitutionCoefficient() const = 0;
 
 		/** 
@@ -58,6 +66,7 @@ namespace bs
 		 *								collision is elastic, and value of 0 means the value is inelastic. Must be in
 		 *								[0, 1] range.
 		 */
+		BS_SCRIPT_EXPORT(ec:PhysicsMaterial)
 		static HPhysicsMaterial create(float staticFriction = 0.0f, float dynamicFriction = 0.0f, float restitution = 0.0f);
 
 		/** @name Internal

+ 3 - 2
Source/BansheeCore/Include/BsPhysicsMesh.h

@@ -14,16 +14,17 @@ namespace bs
 	class FPhysicsMesh;
 
 	/** 
-	 * Represents a physics mesh that can be used for physics MeshCollider%s. Physics mesh can be a generic triangle mesh
+	 * Represents a physics mesh that can be used with a MeshCollider. Physics mesh can be a generic triangle mesh
 	 * or a convex mesh. Convex meshes are limited to 255 faces.
 	 */
-	class BS_CORE_EXPORT PhysicsMesh : public Resource
+	class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics) PhysicsMesh : public Resource
 	{
 	public:
 		PhysicsMesh(const SPtr<MeshData>& meshData, PhysicsMeshType type);
 		virtual ~PhysicsMesh() { }
 
 		/** Returns the type of the physics mesh. */
+		BS_SCRIPT_EXPORT(n:Type,pr:getter)
 		PhysicsMeshType getType() const;
 
 		/** Returns the mesh's indices and vertices. */

+ 0 - 2
Source/MBansheeEngine/MBansheeEngine.csproj

@@ -153,8 +153,6 @@
     <Compile Include="Physics\Interop\NativeSphereCollider.cs" />
     <Compile Include="Physics\Interop\NativeSphericalJoint.cs" />
     <Compile Include="Physics\Physics.cs" />
-    <Compile Include="Physics\PhysicsMaterial.cs" />
-    <Compile Include="Physics\PhysicsMesh.cs" />
     <Compile Include="Physics\PhysicsCommon.cs" />
     <Compile Include="Physics\PlaneCollider.cs" />
     <Compile Include="Physics\Rigidbody.cs" />

+ 3 - 3
Source/MBansheeEngine/Physics/MeshCollider.cs

@@ -27,7 +27,7 @@ namespace BansheeEngine
                 if (mesh == value)
                     return;
 
-                if (IsTrigger && mesh.MeshType == PhysicsMeshType.Triangle)
+                if (IsTrigger && mesh.Type == PhysicsMeshType.Triangle)
                 {
                     Debug.LogWarning("Triangle meshes are not supported on Trigger colliders.");
                     return;
@@ -43,7 +43,7 @@ namespace BansheeEngine
                     {
                         // If triangle mesh its possible the parent can no longer use this collider (they're not supported for 
                         // non-kinematic rigidbodies)
-                        if (mesh != null && mesh.MeshType == PhysicsMeshType.Triangle)
+                        if (mesh != null && mesh.Type == PhysicsMeshType.Triangle)
                             UpdateParentRigidbody();
                         else
                             parent.UpdateMassDistribution();
@@ -56,7 +56,7 @@ namespace BansheeEngine
         protected internal override bool IsValidParent(Rigidbody parent) 
 	    {
 		    // Triangle mesh colliders cannot be used for non-kinematic rigidbodies
-		    return mesh == null|| mesh.MeshType == PhysicsMeshType.Convex || parent.Kinematic;
+		    return mesh == null|| mesh.Type == PhysicsMeshType.Convex || parent.Kinematic;
         }
 
         /// <summary>

+ 0 - 93
Source/MBansheeEngine/Physics/PhysicsMaterial.cs

@@ -1,93 +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
-{
-    /** @addtogroup Physics
-     *  @{
-     */
-
-    /// <summary>
-    /// Material that controls how two physical objects interact with each other. Materials of both objects are used during
-    /// their interaction and their combined values are used.
-    /// </summary>
-    public class PhysicsMaterial : Resource
-    {
-        /// <summary>
-        /// Constructor for internal use by the runtime.
-        /// </summary>
-        private PhysicsMaterial(bool dummy)
-        { }
-
-        /// <summary>
-        /// Creates a brand new physics material.
-        /// </summary>
-        /// <param name="staticFriction">Controls friction when two in-contact objects are not moving lateral to each other.
-        ///                              </param>
-        /// <param name="dynamicFriction">Controls friction when two in-contact objects are moving lateral to each other.
-        ///                               </param>
-        /// <param name="restitution">Controls "bounciness" of an object during a collision. Value of 1 means the collision
-        /// is elastic, and value of 0 means the value is inelastic.</param>
-        public PhysicsMaterial(float staticFriction = 0.0f, float dynamicFriction = 0.0f, float restitution = 0.0f)
-        {
-            Internal_CreateInstance(this, staticFriction, dynamicFriction, restitution);
-        }
-
-        /// <summary>
-        /// Controls friction when two in-contact objects are not moving lateral to each other (for example how difficult is
-        /// to get an object moving from a static state while it is in contact other object(s)).
-        /// </summary>
-        public float StaticFriction
-        {
-            get { return Internal_GetStaticFriction(mCachedPtr); }
-            set { Internal_SetStaticFriction(mCachedPtr, value); }
-        }
-
-
-        /// <summary>
-        /// Controls friction when two in-contact objects are moving lateral to each other (for example how quickly does an
-        /// object slow down when sliding along another object).
-        /// </summary>
-        public float DynamicFriction
-        {
-            get { return Internal_GetDynamicFriction(mCachedPtr); }
-            set { Internal_SetDynamicFriction(mCachedPtr, value); }
-        }
-
-        /// <summary>
-        /// Controls "bounciness" of an object during a collision. Value of 1 means the collision is elastic, and value
-        /// of 0 means the value is inelastic. Must be in [0, 1] range.
-        /// </summary>
-        public float Restitution
-        {
-            get { return Internal_GetRestitution(mCachedPtr); }
-            set { Internal_SetRestitution(mCachedPtr, value); }
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(PhysicsMaterial instance, float staticFriction,
-            float dynamicFriction, float restitution);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetStaticFriction(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetStaticFriction(IntPtr thisPtr, float value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetDynamicFriction(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetDynamicFriction(IntPtr thisPtr, float value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern float Internal_GetRestitution(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetRestitution(IntPtr thisPtr, float value);
-    }
-
-    /** @} */
-}

+ 0 - 64
Source/MBansheeEngine/Physics/PhysicsMesh.cs

@@ -1,64 +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
-{
-    /** @addtogroup Physics
-     *  @{
-     */
-
-    /// <summary>
-    /// Mesh that is used purely for collision purposes and not rendering. For example as a collider or a trigger.
-    /// </summary>
-    public class PhysicsMesh : Resource
-    {
-        /// <summary>
-        /// Constructor for internal use by the runtime.
-        /// </summary>
-        private PhysicsMesh()
-        { }
-
-        /// <summary>
-        /// Retrieves the vertex and index data of the mesh.
-        /// </summary>
-        public MeshData MeshData
-        {
-            get { return Internal_GetMeshData(mCachedPtr); }
-        }
-
-        /// <summary>
-        /// Returns the type of the mesh.
-        /// </summary>
-        public PhysicsMeshType MeshType
-        {
-            get { return (PhysicsMeshType)Internal_GetMeshType(mCachedPtr); }
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern MeshData Internal_GetMeshData(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern int Internal_GetMeshType(IntPtr thisPtr);
-    }
-
-    /// <summary>
-    /// Valid types of a mesh used for physics.
-    /// </summary>
-    public enum PhysicsMeshType // Note: Must match C++ enum PhysicsMeshType
-    {
-        /// <summary>
-        /// A regular triangle mesh. Mesh can be of arbitrary size but cannot be used for triggers and non-kinematic 
-        /// objects. Occurs a significantly larger performance impact than convex meshes.
-        /// </summary>
-        Triangle,
-        /// <summary>
-        /// Mesh representing a convex shape. Mesh will not have more than 256 vertices. Occurs a significantly lower
-        /// performance impact than triangle meshes.
-        /// </summary>
-        Convex
-    }
-
-    /** @} */
-}

+ 2 - 4
Source/SBansheeEngine/CMakeSources.cmake

@@ -95,8 +95,6 @@ set(BS_SBANSHEEENGINE_INC_WRAPPERS
 	"Include/BsScriptLogEntry.h"
 	"Include/BsScriptManagedResource.h"
 	"Include/BsScriptMaterial.h"
-	"Include/BsScriptPhysicsMaterial.h"
-	"Include/BsScriptPhysicsMesh.h"
 	"Include/BsScriptPixelUtility.h"
 	"Include/BsScriptPlainText.h"
 	"Include/BsScriptPrefab.h"
@@ -222,8 +220,6 @@ set(BS_SBANSHEEENGINE_SRC_WRAPPERS
 	"Source/BsScriptLogEntry.cpp"
 	"Source/BsScriptManagedResource.cpp"
 	"Source/BsScriptMaterial.cpp"
-	"Source/BsScriptPhysicsMaterial.cpp"
-	"Source/BsScriptPhysicsMesh.cpp"
 	"Source/BsScriptPixelUtility.cpp"
 	"Source/BsScriptPlainText.cpp"
 	"Source/BsScriptPrefab.cpp"
@@ -309,6 +305,7 @@ set(BS_SBANSHEEENGINE_INC_EXTENSIONS
 	"Include/BsMeshDataEx.h"
 	"Include/BsMeshEx.h"
 	"Include/BsSkeletonEx.h"
+	"Include/BsPhysicsMeshEx.h"
 )
 
 set(BS_SBANSHEEENGINE_SRC_EXTENSIONS
@@ -318,6 +315,7 @@ set(BS_SBANSHEEENGINE_SRC_EXTENSIONS
 	"Source/BsMeshDataEx.cpp"
 	"Source/BsMeshEx.cpp"
 	"Source/BsSkeletonEx.cpp"
+	"Source/BsPhysicsMeshEx.cpp"
 )
 
 source_group("Header Files" FILES ${BS_SBANSHEEENGINE_INC_NOFILTER})

+ 31 - 0
Source/SBansheeEngine/Include/BsPhysicsMeshEx.h

@@ -0,0 +1,31 @@
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEnginePrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsPhysicsMesh.h"
+
+namespace bs
+{
+	/** @addtogroup ScriptInteropEngine
+	 *  @{
+	 */
+	/** @cond SCRIPT_EXTENSIONS */
+
+	/** Extension class for PhysicsMesh, for adding additional functionality for the script version of the class. */
+	class BS_SCR_BE_EXPORT BS_SCRIPT_EXPORT(e:PhysicsMesh) PhysicsMeshEx
+	{
+	public:
+		/** @copydoc PhysicsMesh::create() */
+		BS_SCRIPT_EXPORT(ec:PhysicsMesh)
+		static HPhysicsMesh create(const SPtr<RendererMeshData>& meshData, PhysicsMeshType type = PhysicsMeshType::Convex);
+
+		/** @copydoc PhysicsMesh::getMeshData() */
+		BS_SCRIPT_EXPORT(e:PhysicsMesh,n:MeshData,pr:getter)
+		static SPtr<RendererMeshData> getMeshData(const HPhysicsMesh& thisPtr);
+	};
+
+	/** @endcond */
+	/** @} */
+}

+ 0 - 44
Source/SBansheeEngine/Include/BsScriptPhysicsMaterial.h

@@ -1,44 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEnginePrerequisites.h"
-#include "BsScriptResource.h"
-#include "BsPhysicsMaterial.h"
-
-namespace bs
-{
-	/** @addtogroup ScriptInteropEngine
-	 *  @{
-	 */
-
-	/**	Interop class between C++ & CLR for PhysicsMaterial. */
-	class BS_SCR_BE_EXPORT ScriptPhysicsMaterial : public TScriptResource<ScriptPhysicsMaterial, PhysicsMaterial>
-	{
-	public:
-		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "PhysicsMaterial")
-
-		/**	Creates an empty, uninitialized managed instance of the resource interop object. */
-		static MonoObject* createInstance();
-
-	private:
-		friend class ScriptResourceManager;
-		friend class BuiltinResourceTypes;
-
-		ScriptPhysicsMaterial(MonoObject* instance, const HPhysicsMaterial& material);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_CreateInstance(MonoObject* instance, float staticFriction,
-			float dynamicFriction, float restitution);
-		static float internal_GetStaticFriction(ScriptPhysicsMaterial* thisPtr);
-		static void internal_SetStaticFriction(ScriptPhysicsMaterial* thisPtr, float value);
-		static float internal_GetDynamicFriction(ScriptPhysicsMaterial* thisPtr);
-		static void internal_SetDynamicFriction(ScriptPhysicsMaterial* thisPtr, float value);
-		static float internal_GetRestitution(ScriptPhysicsMaterial* thisPtr);
-		static void internal_SetRestitution(ScriptPhysicsMaterial* thisPtr, float value);
-	};
-
-	/** @} */
-}

+ 0 - 38
Source/SBansheeEngine/Include/BsScriptPhysicsMesh.h

@@ -1,38 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsScriptEnginePrerequisites.h"
-#include "BsScriptResource.h"
-#include "BsPhysicsMesh.h"
-
-namespace bs
-{
-	/** @addtogroup ScriptInteropEngine
-	 *  @{
-	 */
-
-	/**	Interop class between C++ & CLR for PhysicsMesh. */
-	class BS_SCR_BE_EXPORT ScriptPhysicsMesh : public TScriptResource<ScriptPhysicsMesh, PhysicsMesh>
-	{
-	public:
-		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "PhysicsMesh")
-
-		/**	Creates an empty, uninitialized managed instance of the resource interop object. */
-		static MonoObject* createInstance();
-
-	private:
-		friend class ScriptResourceManager;
-		friend class BuiltinResourceTypes;
-
-		ScriptPhysicsMesh(MonoObject* instance, const HPhysicsMesh& mesh);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static MonoObject* internal_GetMeshData(ScriptPhysicsMesh* thisPtr);
-		static int internal_GetMeshType(ScriptPhysicsMesh* thisPtr);
-	};
-
-	/** @} */
-}

+ 17 - 0
Source/SBansheeEngine/Source/BsPhysicsMeshEx.cpp

@@ -0,0 +1,17 @@
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#include "BsPhysicsMeshEx.h"
+#include "BsRendererMeshData.h"
+
+namespace bs
+{
+	HPhysicsMesh PhysicsMeshEx::create(const SPtr<RendererMeshData>& meshData, PhysicsMeshType type)
+	{
+		return PhysicsMesh::create(meshData->getData(), type);
+	}
+
+	SPtr<RendererMeshData> PhysicsMeshEx::getMeshData(const HPhysicsMesh& thisPtr)
+	{
+		return RendererMeshData::create(thisPtr->getMeshData());
+	}
+}

+ 2 - 2
Source/SBansheeEngine/Source/BsScriptAssemblyManager.cpp

@@ -43,13 +43,13 @@
 #include "BsScriptPrefab.h"
 #include "BsScriptStringTable.h"
 #include "BsScriptGUISkin.h"
-#include "BsScriptPhysicsMaterial.h"
-#include "BsScriptPhysicsMesh.h"
 #include "BsScriptAudioClip.h"
 #include "BsScriptAnimationClip.h"
 #include "BsBuiltinResourceLookup.h"
 
 #include "BsScriptMesh.generated.h"
+#include "BsScriptPhysicsMesh.generated.h"
+#include "BsScriptPhysicsMaterial.generated.h"
 
 namespace bs
 {

+ 2 - 1
Source/SBansheeEngine/Source/BsScriptCollider.cpp

@@ -7,11 +7,12 @@
 #include "BsCollider.h"
 #include "BsRigidbody.h"
 #include "BsScriptRigidbody.h"
-#include "BsScriptPhysicsMaterial.h"
 #include "BsScriptCollisionData.h"
 #include "BsScriptPhysicsQueryHit.h"
 #include "BsScriptResourceManager.h"
 
+#include "BsScriptPhysicsMaterial.generated.h"
+
 using namespace std::placeholders;
 
 namespace bs

+ 2 - 1
Source/SBansheeEngine/Source/BsScriptMeshCollider.cpp

@@ -2,9 +2,10 @@
 //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
 #include "BsScriptMeshCollider.h"
 #include "BsMeshCollider.h"
-#include "BsScriptPhysicsMesh.h"
 #include "BsScriptResourceManager.h"
 
+#include "BsScriptPhysicsMesh.generated.h"
+
 namespace bs
 {
 	ScriptMeshCollider::ScriptMeshCollider(MonoObject* instance, const SPtr<Collider>& collider)

+ 2 - 1
Source/SBansheeEngine/Source/BsScriptPhysics.cpp

@@ -5,10 +5,11 @@
 #include "BsMonoClass.h"
 #include "BsMonoUtil.h"
 #include "BsPhysics.h"
-#include "BsScriptPhysicsMesh.h"
 #include "BsScriptCollider.h"
 #include "BsCollider.h"
 
+#include "BsScriptPhysicsMesh.generated.h"
+
 namespace bs
 {
 	ScriptPhysics::ScriptPhysics(MonoObject* instance)

+ 0 - 80
Source/SBansheeEngine/Source/BsScriptPhysicsMaterial.cpp

@@ -1,80 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#include "BsScriptPhysicsMaterial.h"
-#include "BsScriptResourceManager.h"
-#include "BsScriptMeta.h"
-#include "BsMonoClass.h"
-#include "BsMonoManager.h"
-
-namespace bs
-{
-	ScriptPhysicsMaterial::ScriptPhysicsMaterial(MonoObject* instance, const HPhysicsMaterial& material)
-		:TScriptResource(instance, material)
-	{
-
-	}
-
-	void ScriptPhysicsMaterial::initRuntimeData()
-	{
-		metaData.scriptClass->addInternalCall("Internal_CreateInstance", &ScriptPhysicsMaterial::internal_CreateInstance);
-		metaData.scriptClass->addInternalCall("Internal_GetStaticFriction", &ScriptPhysicsMaterial::internal_GetStaticFriction);
-		metaData.scriptClass->addInternalCall("Internal_SetStaticFriction", &ScriptPhysicsMaterial::internal_SetStaticFriction);
-		metaData.scriptClass->addInternalCall("Internal_GetDynamicFriction", &ScriptPhysicsMaterial::internal_GetDynamicFriction);
-		metaData.scriptClass->addInternalCall("Internal_SetDynamicFriction", &ScriptPhysicsMaterial::internal_SetDynamicFriction);
-		metaData.scriptClass->addInternalCall("Internal_GetRestitution", &ScriptPhysicsMaterial::internal_GetRestitution);
-		metaData.scriptClass->addInternalCall("Internal_SetRestitution", &ScriptPhysicsMaterial::internal_SetRestitution);
-	}
-
-	void ScriptPhysicsMaterial::internal_CreateInstance(MonoObject* instance, float staticFriction,
-		float dynamicFriction, float restitution)
-	{
-		HPhysicsMaterial material = PhysicsMaterial::create(staticFriction, dynamicFriction, restitution);
-		ScriptResourceBase* scriptInstance = ScriptResourceManager::instance().createBuiltinScriptResource(material, instance);
-	}
-
-	float ScriptPhysicsMaterial::internal_GetStaticFriction(ScriptPhysicsMaterial* thisPtr)
-	{
-		HPhysicsMaterial material = thisPtr->getHandle();
-		return material->getStaticFriction();
-	}
-
-	void ScriptPhysicsMaterial::internal_SetStaticFriction(ScriptPhysicsMaterial* thisPtr, float value)
-	{
-		HPhysicsMaterial material = thisPtr->getHandle();
-		material->setStaticFriction(value);
-	}
-
-	float ScriptPhysicsMaterial::internal_GetDynamicFriction(ScriptPhysicsMaterial* thisPtr)
-	{
-		HPhysicsMaterial material = thisPtr->getHandle();
-		return material->getDynamicFriction();
-	}
-
-	void ScriptPhysicsMaterial::internal_SetDynamicFriction(ScriptPhysicsMaterial* thisPtr, float value)
-	{
-		HPhysicsMaterial material = thisPtr->getHandle();
-		material->setDynamicFriction(value);
-	}
-
-	float ScriptPhysicsMaterial::internal_GetRestitution(ScriptPhysicsMaterial* thisPtr)
-	{
-		HPhysicsMaterial material = thisPtr->getHandle();
-		return material->getRestitutionCoefficient();
-	}
-
-	void ScriptPhysicsMaterial::internal_SetRestitution(ScriptPhysicsMaterial* thisPtr, float value)
-	{
-		HPhysicsMaterial material = thisPtr->getHandle();
-		material->setRestitutionCoefficient(value);
-	}
-
-	MonoObject* ScriptPhysicsMaterial::createInstance()
-	{
-		bool dummy = false;
-
-		void* params[1];
-		params[0] = &dummy;
-
-		return metaData.scriptClass->createInstance("bool", params);
-	}
-}

+ 0 - 43
Source/SBansheeEngine/Source/BsScriptPhysicsMesh.cpp

@@ -1,43 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#include "BsScriptPhysicsMesh.h"
-#include "BsScriptResourceManager.h"
-#include "BsScriptMeta.h"
-#include "BsMonoClass.h"
-#include "BsMonoManager.h"
-
-#include "BsScriptRendererMeshData.generated.h"
-
-namespace bs
-{
-	ScriptPhysicsMesh::ScriptPhysicsMesh(MonoObject* instance, const HPhysicsMesh& mesh)
-		:TScriptResource(instance, mesh)
-	{
-
-	}
-
-	void ScriptPhysicsMesh::initRuntimeData()
-	{
-		metaData.scriptClass->addInternalCall("Internal_GetMeshData", &ScriptPhysicsMesh::internal_GetMeshData);
-		metaData.scriptClass->addInternalCall("Internal_GetMeshType", &ScriptPhysicsMesh::internal_GetMeshType);
-	}
-
-	MonoObject* ScriptPhysicsMesh::internal_GetMeshData(ScriptPhysicsMesh* thisPtr)
-	{
-		HPhysicsMesh mesh = thisPtr->getHandle();
-
-		SPtr<MeshData> meshData = mesh->getMeshData();
-		return ScriptRendererMeshData::create(RendererMeshData::create(meshData));
-	}
-
-	int ScriptPhysicsMesh::internal_GetMeshType(ScriptPhysicsMesh* thisPtr)
-	{
-		HPhysicsMesh mesh = thisPtr->getHandle();
-		return (int)mesh->getType();
-	}
-
-	MonoObject* ScriptPhysicsMesh::createInstance()
-	{
-		return metaData.scriptClass->createInstance();
-	}
-}