public ModelInstance(String n, Model baseM, Matrix4 trans) { name = n; baseModel = baseM; position = trans.Row3.Xyz; transform = trans; }
public ModelInstance (String n, Model baseM, Vector3 pos, Quaternion rot, uint modelId, int rID, string lName) { name = n; baseModel = baseM; position = pos; transform = new Matrix4(new Vector4(Vector3.Transform(Vector3.UnitX, rot), 0), new Vector4(Vector3.Transform(Vector3.UnitY, rot), 0), new Vector4(Vector3.Transform(Vector3.UnitZ, rot), 0), new Vector4(pos, 1)); id = modelId; roomID = rID; layoutName = lName; //Need to make bounding boxes bounds = new BoundingBox[meshes.Length]; for (int i = 0; i < bounds.Length; i++) { bounds[i] = new BoundingBox(meshes[i].bounds, transform); } }