| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- //********************************** 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
- }
- /** @} */
- }
|