using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace BansheeEngine
{
/** @addtogroup Physics
* @{
*/
///
/// 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.
///
[ShowInInspector]
public partial class PhysicsMesh : Resource
{
private PhysicsMesh(bool __dummy0) { }
protected PhysicsMesh() { }
/// Creates a new physics mesh.
/// Index and vertices of the mesh data.
///
/// Type of the mesh. If convex the provided mesh geometry will be converted into a convex mesh (that might not be the
/// same as the provided mesh data).
///
public PhysicsMesh(MeshData meshData, PhysicsMeshType type = PhysicsMeshType.Convex)
{
Internal_create(this, meshData, type);
}
/// Returns a reference wrapper for this resource.
public RRef Ref
{
get { return Internal_GetRef(mCachedPtr); }
}
/// Returns the type of the physics mesh.
[ShowInInspector]
[NativeWrapper]
public PhysicsMeshType Type
{
get { return Internal_getType(mCachedPtr); }
}
/// Returns the mesh's indices and vertices.
[ShowInInspector]
[NativeWrapper]
public MeshData MeshData
{
get { return Internal_getMeshData(mCachedPtr); }
}
/// Returns a reference wrapper for this resource.
public static implicit operator RRef(PhysicsMesh x)
{ return Internal_GetRef(x.mCachedPtr); }
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern RRef Internal_GetRef(IntPtr thisPtr);
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern PhysicsMeshType Internal_getType(IntPtr thisPtr);
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void Internal_create(PhysicsMesh managedInstance, MeshData meshData, PhysicsMeshType type);
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern MeshData Internal_getMeshData(IntPtr thisPtr);
}
/** @} */
}