Пример #1
0
 /// <summary>Translate, Rotate, Scale. Creates a transform Matrix using all these components!</summary>
 /// <param name="translation">Move an object by this amount.</param>
 /// <param name="rotation">A Quaternion describing the rotation for this transform.</param>
 /// <param name="scale">How much larger or smaller this transform makes things. 1 is a good
 /// default, as 0 will shrink it to nothing! This will expand to a scale vector of (size, size, size)</param>
 /// <returns>A Matrix that combines translation, roatation, and scale information into a single Matrix!</returns>
 public static Matrix TRS(Vec3 translation, Quat rotation, float scale = 1) => NativeAPI.matrix_trs(translation, rotation, new Vec3(scale, scale, scale));
Пример #2
0
 public static Quat Lerp(Quat a, Quat b, float lerp) => NativeAPI.quat_lerp(a, b, lerp);
Пример #3
0
 /// <summary>Basic initialization constructor! Just copies in the provided values directly.</summary>
 /// <param name="x">X location of the pose.</param>
 /// <param name="y">Y location of the pose.</param>
 /// <param name="z">Z location of the pose.</param>
 /// <param name="orientation">Orientation of the pose, stored as a rotation from Vec3.Forward.</param>
 public Pose(float x, float y, float z, Quat orientation)
 {
     this.position    = new Vec3(x, y, z);
     this.orientation = orientation;
 }
Пример #4
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern Vec3 quat_mul_vec(ref Quat a, ref Vec3 b);
Пример #5
0
 public static Quat Difference(Quat a, Quat b) => NativeAPI.quat_difference(a, b);
Пример #6
0
 public HandJoint(Vec3 position, Quat orientation, float radius)
 {
     this.position    = position;
     this.orientation = orientation;
     this.radius      = radius;
 }
Пример #7
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern Quat quat_normalize(ref Quat a);
Пример #8
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern void   solid_teleport(IntPtr solid, ref Vec3 position, ref Quat rotation);
Пример #9
0
        ///////////////////////////////////////////

        [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern Quat quat_difference(ref Quat a, ref Quat b);
Пример #10
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern void transform_set_rotation(IntPtr transform, ref Quat rotation);
Пример #11
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr solid_create(ref Vec3 position, ref Quat rotation, SolidType type = SolidType.Normal);
Пример #12
0
 /// <summary>Interpolates between two poses! t is unclamped, so values outside of (0,1) will
 /// extrapolate their position.</summary>
 /// <param name="a">Starting pose, or percent == 0</param>
 /// <param name="b">Ending pose, or percent == 1</param>
 /// <param name="percent">A value usually 0->1 that tells the blend between a and b.</param>
 /// <returns>A new pose, blended between a and b based on percent!</returns>
 public static Pose Lerp(Pose a, Pose b, float percent)
 => new Pose(Vec3.Lerp(a.position, b.position, percent), Quat.Slerp(a.orientation, b.orientation, percent));
Пример #13
0
 public void Teleport(Vec3 position, Quat rotation)
 {
     NativeAPI.solid_teleport(_solidInst, position, rotation);
 }
Пример #14
0
 public void Move(Vec3 position, Quat rotation)
 {
     NativeAPI.solid_move(_solidInst, position, rotation);
 }
Пример #15
0
 /// <summary>Translate, Rotate, Scale. Creates a transform Matrix using all these components!</summary>
 /// <param name="translation">Move an object by this amount.</param>
 /// <param name="rotation">A Quaternion describing the rotation for this transform.</param>
 /// <param name="scale">How much larger or smaller this transform makes things. Vec3.One is a good
 /// default, as Vec3.Zero will shrink it to nothing!</param>
 /// <returns>A Matrix that combines translation, roatation, and scale information into a single Matrix!</returns>
 public static Matrix TRS(Vec3 translation, Quat rotation, Vec3 scale) => NativeAPI.matrix_trs(translation, rotation, scale);
Пример #16
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern Quat quat_lerp(ref Quat a, ref Quat b, float t);
Пример #17
0
 public Pose(Vec3 position, Quat orientation)
 {
     this.position    = position;
     this.orientation = orientation;
 }
Пример #18
0
 public static Quat Slerp(Quat a, Quat b, float slerp) => NativeAPI.quat_slerp(a, b, slerp);