@@ -68,13 +68,26 @@ public void Vector3_RotateAround_Euler()
6868 [ Test ]
6969 public void Vector3_TransformPoint ( )
7070 {
71- throw new NotImplementedException ( ) ;
71+ Vector3 point = new Vector3 ( 1f , 2f , 3f ) ;
72+ Vector3 scale = new Vector3 ( 2f , 3f , 4f ) ; // scaled point: (2, 6, 12)
73+ Quaternion rotation = Quaternion . AngleAxis ( 180f , Vector3 . up ) ; // scaled rotated point: (-2, 6, -12)
74+ Vector3 translation = new Vector3 ( 3f , 4f , 5f ) ; // translated scaled rotated point: (1, 10, -7)
75+ Vector3 expected = new Vector3 ( 1 , 10 , - 7 ) ;
76+ Vector3 result = point . TransformPoint ( translation , rotation , scale ) ;
77+ Assert . That ( Vector3 . Distance ( result , expected ) , Is . LessThan ( 0.00001f ) ) ;
7278 }
7379
7480 [ Test ]
7581 public void Vector3_InverseTransformPoint ( )
7682 {
77- throw new NotImplementedException ( ) ;
83+ // Perform the same transformation as Vector3_TransformPoint in reverse.
84+ Vector3 point = new Vector3 ( 1 , 10 , - 7 ) ;
85+ Vector3 scale = new Vector3 ( 2f , 3f , 4f ) ;
86+ Quaternion rotation = Quaternion . AngleAxis ( 180f , Vector3 . up ) ;
87+ Vector3 translation = new Vector3 ( 3f , 4f , 5f ) ;
88+ Vector3 expected = new Vector3 ( 1f , 2f , 3f ) ;
89+ Vector3 result = point . InverseTransformPoint ( translation , rotation , scale ) ;
90+ Assert . That ( Vector3 . Distance ( result , expected ) , Is . LessThan ( 0.00001f ) ) ;
7891 }
7992
8093 [ Test ]
0 commit comments