public void Test_Matrix() { var bullet = new BulletSharp.Matrix (); bullet.M11 = 1; bullet.M12 = 2; bullet.M13 = 3; bullet.M14 = 4; bullet.M21 = 5; bullet.M22 = 6; bullet.M23 = 7; bullet.M24 = 8; bullet.M31 = 9; bullet.M32 = 10; bullet.M33 = 11; bullet.M34 = 12; bullet.M41 = 13; bullet.M42 = 14; bullet.M43 = 15; bullet.M44 = 16; var dd = new Matrix4x4(1,5,9,13, 2,6,10,14, 3,7,11,15, 4,8,12,16); Assert.AreEqual (dd, bullet.ToDD()); Assert.AreEqual (bullet, dd.ToBullet ()); }
public static Matrix4 Convert(ref BulletSharp.Matrix m) { return(new Matrix4( m.M11, m.M12, m.M13, m.M14, m.M21, m.M22, m.M23, m.M24, m.M31, m.M32, m.M33, m.M34, m.M41, m.M42, m.M43, m.M44)); }
public static BulletSharp.Matrix Convert(ref Matrix4 m) { BulletSharp.Matrix r = new BulletSharp.Matrix(); r.M11 = m.M11; r.M12 = m.M12; r.M13 = m.M13; r.M14 = m.M14; r.M21 = m.M21; r.M22 = m.M22; r.M23 = m.M23; r.M24 = m.M24; r.M31 = m.M31; r.M32 = m.M32; r.M33 = m.M33; r.M34 = m.M34; r.M41 = m.M41; r.M42 = m.M42; r.M43 = m.M43; r.M44 = m.M44; return(r); }
public static BulletSharp.Matrix Convert(Matrix m) { BulletSharp.Matrix r = new BulletSharp.Matrix(); r.M11 = m.M11; r.M12 = m.M12; r.M13 = m.M13; r.M14 = m.M14; r.M21 = m.M21; r.M22 = m.M22; r.M23 = m.M23; r.M24 = m.M24; r.M31 = m.M31; r.M32 = m.M32; r.M33 = m.M33; r.M34 = m.M34; r.M41 = m.M41; r.M42 = m.M42; r.M43 = m.M43; r.M44 = m.M44; return r; }
void Start () { Matrix4x4 unityMatrix = Matrix4x4.TRS (transform.localPosition, transform.localRotation, UnityEngine.Vector3.one); BulletSharp.Matrix bulletMatrix = new BulletSharp.Matrix ( unityMatrix.m00, unityMatrix.m10, unityMatrix.m20, unityMatrix.m30, unityMatrix.m01, unityMatrix.m11, unityMatrix.m21, unityMatrix.m31, unityMatrix.m02, unityMatrix.m12, unityMatrix.m22, unityMatrix.m32, unityMatrix.m03, unityMatrix.m13, unityMatrix.m23, unityMatrix.m33); BtCompoundShape c = transform.parent.GetComponent<BtCompoundShape> (); c.AddChildShape (bulletMatrix, shape.Shape); }
/// <summary> /// DDの行列をBulletPhysicsの行列に変更 /// </summary> /// <param name="m">DDの行列</param> /// <returns>BulletPhysicsの行列</returns> public static BulletSharp.Matrix ToBullet(this Matrix4x4 m) { var mat = new BulletSharp.Matrix (); mat.M11 = m[0]; mat.M12 = m[4]; mat.M13 = m[8]; mat.M14 = m[12]; mat.M21 = m[1]; mat.M22 = m[5]; mat.M23 = m[9]; mat.M24 = m[13]; mat.M31 = m[2]; mat.M32 = m[6]; mat.M33 = m[10]; mat.M34 = m[14]; mat.M41 = m[3]; mat.M42 = m[7]; mat.M43 = m[11]; mat.M44 = m[15]; return mat; }