/// <summary> /// Builds a cube into this Geometry (this cube is built up of 24 vertices, so texture coordinates and normals are set) /// </summary> /// <param name="target">Target <see cref="GeometrySurface"/>.</param> /// <param name="bottomCenter">Bottom center point of the cube.</param> /// <param name="width">Width (and depth) of the cube.</param> /// <param name="height">Height of the cube.</param> public static BuiltVerticesRange BuildCube(this GeometrySurface target, Vector3 bottomCenter, float width, float height) { var start = new Vector3( bottomCenter.X - width / 2f, bottomCenter.Y, bottomCenter.Z - width / 2f); var size = new Vector3(width, height, width); return(target.BuildCube(start, size)); }
/// <summary> /// Builds a cube on the given point with the given color. /// </summary> /// <param name="target">Target <see cref="GeometrySurface"/>.</param> /// <param name="centerLocation">The location to draw the cube at.</param> /// <param name="sideLength">The side length of the cube.</param> public static BuiltVerticesRange BuildCube(this GeometrySurface target, Vector3 centerLocation, float sideLength) { return(target.BuildCube( centerLocation - new Vector3(sideLength / 2f, sideLength / 2f, sideLength / 2f), new Vector3(sideLength, sideLength, sideLength))); }
/// <summary> /// Builds a cube into this Geometry (this cube is built up of 24 vertices, so texture coordinates and normals are set) /// </summary> /// <param name="target">Target <see cref="GeometrySurface"/>.</param> /// <param name="box">Box defining bounds of generated cube.</param> public static BuiltVerticesRange BuildCube(this GeometrySurface target, BoundingBox box) { return(target.BuildCube(box.Minimum, box.GetSize())); }