| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using System;
- using System.Runtime.CompilerServices;
- using System.Runtime.InteropServices;
- namespace BansheeEngine
- {
- /** @addtogroup Physics
- * @{
- */
- /// <summary>Contains data about a collision of a character controller and a collider.</summary>
- [StructLayout(LayoutKind.Sequential), SerializeObject]
- public partial struct ControllerColliderCollision
- {
- ///<summary>
- /// Returns a subset of this struct. This subset usually contains common fields shared with another struct.
- ///</summary>
- public ControllerCollision GetBase()
- {
- ControllerCollision value;
- value.position = position;
- value.normal = normal;
- value.motionDir = motionDir;
- value.motionAmount = motionAmount;
- return value;
- }
- ///<summary>
- /// Assigns values to a subset of fields of this struct. This subset usually contains common field shared with
- /// another struct.
- ///</summary>
- public void SetBase(ControllerCollision value)
- {
- position = value.position;
- normal = value.normal;
- motionDir = value.motionDir;
- motionAmount = value.motionAmount;
- }
- /// <summary>
- /// Component of the controller that was touched. Can be null if the controller has no component parent, in which case
- /// check #colliderRaw.
- /// </summary>
- public Collider collider;
- /// <summary>Touched triangle index for mesh colliders.</summary>
- public uint triangleIndex;
- /// <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;
- }
- /** @} */
- }
|