| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 |
- using System;
- using System.Runtime.CompilerServices;
- using System.Runtime.InteropServices;
- namespace BansheeEngine
- {
- /** @addtogroup Physics
- * @{
- */
- /// <summary>
- /// Represents the most customizable type of joint. This joint type can be used to create all other built-in joint types,
- /// and to design your own custom ones, but is less intuitive to use. Allows a specification of a linear constraint (for
- /// example for slider), twist constraint (rotating around X) and swing constraint (rotating around Y and Z). It also
- /// allows you to constrain limits to only specific axes or completely lock specific axes.
- /// </summary>
- [ShowInInspector]
- public partial class D6Joint : Joint
- {
- private D6Joint(bool __dummy0) { }
- protected D6Joint() { }
- /// <summary>Returns the current rotation of the joint around the X axis.</summary>
- [ShowInInspector]
- [NativeWrapper]
- public Radian Twist
- {
- get
- {
- Radian temp;
- Internal_getTwist(mCachedPtr, out temp);
- return temp;
- }
- }
- /// <summary>Returns the current rotation of the joint around the Y axis.</summary>
- [ShowInInspector]
- [NativeWrapper]
- public Radian SwingY
- {
- get
- {
- Radian temp;
- Internal_getSwingY(mCachedPtr, out temp);
- return temp;
- }
- }
- /// <summary>Returns the current rotation of the joint around the Z axis.</summary>
- [ShowInInspector]
- [NativeWrapper]
- public Radian SwingZ
- {
- get
- {
- Radian temp;
- Internal_getSwingZ(mCachedPtr, out temp);
- return temp;
- }
- }
- /// <summary>Determines the linear limit used for constraining translation degrees of freedom.</summary>
- [ShowInInspector]
- [NativeWrapper]
- public LimitLinear LimitLinear
- {
- get
- {
- LimitLinear temp;
- Internal_getLimitLinear(mCachedPtr, out temp);
- return temp;
- }
- set { Internal_setLimitLinear(mCachedPtr, ref value); }
- }
- /// <summary>
- /// Determines the angular limit used for constraining the twist (rotation around X) degree of freedom.
- /// </summary>
- [ShowInInspector]
- [NativeWrapper]
- public LimitAngularRange LimitTwist
- {
- get
- {
- LimitAngularRange temp;
- Internal_getLimitTwist(mCachedPtr, out temp);
- return temp;
- }
- set { Internal_setLimitTwist(mCachedPtr, ref value); }
- }
- /// <summary>
- /// Determines the cone limit used for constraining the swing (rotation around Y and Z) degree of freedom.
- /// </summary>
- [ShowInInspector]
- [NativeWrapper]
- public LimitConeRange LimitSwing
- {
- get
- {
- LimitConeRange temp;
- Internal_getLimitSwing(mCachedPtr, out temp);
- return temp;
- }
- set { Internal_setLimitSwing(mCachedPtr, ref value); }
- }
- /// <summary>Returns the drive's target position relative to the joint's first body.</summary>
- [ShowInInspector]
- [NativeWrapper]
- public Vector3 DrivePosition
- {
- get
- {
- Vector3 temp;
- Internal_getDrivePosition(mCachedPtr, out temp);
- return temp;
- }
- }
- /// <summary>Returns the drive's target rotation relative to the joint's first body.</summary>
- [ShowInInspector]
- [NativeWrapper]
- public Quaternion DriveRotation
- {
- get
- {
- Quaternion temp;
- Internal_getDriveRotation(mCachedPtr, out temp);
- return temp;
- }
- }
- /// <summary>Returns the drive's target linear velocity.</summary>
- [ShowInInspector]
- [NativeWrapper]
- public Vector3 DriveLinearVelocity
- {
- get
- {
- Vector3 temp;
- Internal_getDriveLinearVelocity(mCachedPtr, out temp);
- return temp;
- }
- }
- /// <summary>Returns the drive's target angular velocity.</summary>
- [ShowInInspector]
- [NativeWrapper]
- public Vector3 DriveAngularVelocity
- {
- get
- {
- Vector3 temp;
- Internal_getDriveAngularVelocity(mCachedPtr, out temp);
- return temp;
- }
- }
- /// <summary>Returns motion constraint for the specified axis.</summary>
- public D6JointMotion GetMotion(D6JointAxis axis)
- {
- return Internal_getMotion(mCachedPtr, axis);
- }
- /// <summary>
- /// Allows you to constrain motion of the specified axis. Be aware that when setting drives for a specific axis you must
- /// also take care not to constrain its motion in a conflicting way (for example you cannot add a drive that moves the
- /// joint on X axis, and then lock the X axis).
- ///
- /// Unlocking translations degrees of freedom allows the bodies to move along the subset of the unlocked axes. (for
- /// example unlocking just one translational axis is the equivalent of a slider joint.)
- ///
- /// Angular degrees of freedom are partitioned as twist (around X axis) and swing (around Y and Z axes). Different
- /// effects can be achieves by unlocking their various combinations: - If a single degree of angular freedom is unlocked
- /// it should be the twist degree as it has extra options for that case (for example for a hinge joint). - If both swing
- /// degrees are unlocked but twist is locked the result is a zero-twist joint. - If one swing and one twist degree of
- /// freedom are unlocked the result is a zero-swing joint (for example an arm attached at the elbow) - If all angular
- /// degrees of freedom are unlocked the result is the same as the spherical joint.
- /// </summary>
- public void SetMotion(D6JointAxis axis, D6JointMotion motion)
- {
- Internal_setMotion(mCachedPtr, axis, motion);
- }
- /// <summary>
- /// Determines a drive that will attempt to move the specified degree(s) of freedom to the wanted position and velocity.
- /// </summary>
- public D6JointDrive GetDrive(D6JointDriveType type)
- {
- D6JointDrive temp;
- Internal_getDrive(mCachedPtr, type, out temp);
- return temp;
- }
- /// <summary>
- /// Determines a drive that will attempt to move the specified degree(s) of freedom to the wanted position and velocity.
- /// </summary>
- public void SetDrive(D6JointDriveType type, D6JointDrive drive)
- {
- Internal_setDrive(mCachedPtr, type, ref drive);
- }
- /// <summary>Sets the drive's target position and rotation relative to the joint's first body.</summary>
- public void SetDriveTransform(Vector3 position, Quaternion rotation)
- {
- Internal_setDriveTransform(mCachedPtr, ref position, ref rotation);
- }
- /// <summary>Sets the drive's target linear and angular velocities.</summary>
- public void SetDriveVelocity(Vector3 linear, Vector3 angular)
- {
- Internal_setDriveVelocity(mCachedPtr, ref linear, ref angular);
- }
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern D6JointMotion Internal_getMotion(IntPtr thisPtr, D6JointAxis axis);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_setMotion(IntPtr thisPtr, D6JointAxis axis, D6JointMotion motion);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_getTwist(IntPtr thisPtr, out Radian __output);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_getSwingY(IntPtr thisPtr, out Radian __output);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_getSwingZ(IntPtr thisPtr, out Radian __output);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_getLimitLinear(IntPtr thisPtr, out LimitLinear __output);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_setLimitLinear(IntPtr thisPtr, ref LimitLinear limit);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_getLimitTwist(IntPtr thisPtr, out LimitAngularRange __output);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_setLimitTwist(IntPtr thisPtr, ref LimitAngularRange limit);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_getLimitSwing(IntPtr thisPtr, out LimitConeRange __output);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_setLimitSwing(IntPtr thisPtr, ref LimitConeRange limit);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_getDrive(IntPtr thisPtr, D6JointDriveType type, out D6JointDrive __output);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_setDrive(IntPtr thisPtr, D6JointDriveType type, ref D6JointDrive drive);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_getDrivePosition(IntPtr thisPtr, out Vector3 __output);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_getDriveRotation(IntPtr thisPtr, out Quaternion __output);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_setDriveTransform(IntPtr thisPtr, ref Vector3 position, ref Quaternion rotation);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_getDriveLinearVelocity(IntPtr thisPtr, out Vector3 __output);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_getDriveAngularVelocity(IntPtr thisPtr, out Vector3 __output);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern void Internal_setDriveVelocity(IntPtr thisPtr, ref Vector3 linear, ref Vector3 angular);
- }
- /** @} */
- }
|