//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
//**************** Copyright (c) 2016 Marko Pintera (marko.pintera@gmail.com). All rights reserved. **********************//
using System;
using System.Runtime.CompilerServices;
namespace BansheeEngine
{
/** @addtogroup Physics
* @{
*/
///
/// Mesh that is used purely for collision purposes and not rendering. For example as a collider or a trigger.
///
public class PhysicsMesh : Resource
{
///
/// Constructor for internal use by the runtime.
///
private PhysicsMesh()
{ }
///
/// Retrieves the vertex and index data of the mesh.
///
public MeshData MeshData
{
get { return Internal_GetMeshData(mCachedPtr); }
}
///
/// Returns the type of the mesh.
///
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);
}
///
/// Valid types of a mesh used for physics.
///
public enum PhysicsMeshType // Note: Must match C++ enum 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.
///
Triangle,
///
/// Mesh representing a convex shape. Mesh will not have more than 256 vertices. Occurs a significantly lower
/// performance impact than triangle meshes.
///
Convex
}
/** @} */
}