Hi! I’m trying to convert world coordinates to local coordinates without using a Transform. (For performance reasons i can’t use gameobjects and transforms this time.) I think i need to use a matrix but i don’t understand matrices. Can anyone give me some hints?

Ok so if anyone else is searching for an oriented bounding box here’s my implementation:
The last method is what i was looking for, found it somewhere else but don’t remember where. If anyone finds a better or more efficient solution please post it here.

        public class Cuboid {
			public Vector3 Center { get; set; }
			public Quaternion Rotation { get; set; }
			public Vector3 Size { get; set; }

			public Cuboid (Vector3 center, Vector3 size, Quaternion rot) {
				Center = center;
				Size = size;
				Rotation = rot;
			}

			public bool Contains (Vector3 worldPoint) {
				Vector3 extents = AbsoluteVector(Size) / 2;

				Vector3 projected = RotatePointAroundPivot(Center, worldPoint, Rotation);

				Vector3 max = Center + extents;
				Vector3 min = Center - extents;

				if (projected.x <= max.x && projected.y <= max.y && projected.z <= max.z && projected.x >= min.x && projected.y >= min.y && projected.z >= min.z) return true;
				else return false;
			}

            public static Vector3 RotatePointAroundPivot(Vector3 pivot, Vector3 point, Quaternion angle) {
                angle = Quaternion.Inverse(angle);
                Vector3 direction = pivot - point;
                direction = angle * direction;
                return direction + pivot;
        	}

            public static Vector3 AbsoluteVector (Vector3 initial){
                initial.x = Mathf.Abs(initial.x);
                initial.y = Mathf.Abs(initial.y);
                initial.z = Mathf.Abs(initial.z);
                return initial;
            }
        }