Class GeometricPrimitive.Capsule
- Namespace
- Stride.Graphics.GeometricPrimitives
- Assembly
- Stride.Graphics.dll
A sphere primitive.
public static class GeometricPrimitive.Capsule
- Inheritance
-
objectGeometricPrimitive.Capsule
Methods
New(GraphicsDevice, float, float, int, float, float, bool)
Creates a sphere primitive.
public static GeometricPrimitive New(GraphicsDevice device, float length, float radius, int tessellation, float uScale, float vScale, bool toLeftHanded)
Parameters
deviceGraphicsDeviceThe device.
lengthfloatThe length. That is the distance between the two sphere centers.
radiusfloatThe radius of the capsule.
tessellationintThe tessellation.
uScalefloatScale U coordinates between 0 and the values of this parameter.
vScalefloatScale V coordinates 0 and the values of this parameter.
toLeftHandedboolif set to
truevertices and indices will be transformed to left handed.
Returns
- GeometricPrimitive
A sphere primitive.
Exceptions
- ArgumentOutOfRangeException
tessellation;Must be >= 3
New(GraphicsDevice, float, float, int, float, float, bool, int)
Creates a capsule primitive with additional rings along its length.
public static GeometricPrimitive New(GraphicsDevice device, float length = 1, float radius = 0.5, int tessellation = 8, float uScale = 1, float vScale = 1, bool toLeftHanded = false, int lengthRings = 0)
Parameters
deviceGraphicsDeviceThe device.
lengthfloatThe length. That is the distance between the two sphere centers.
radiusfloatThe radius of the capsule.
tessellationintThe tessellation.
uScalefloatScale U coordinates between 0 and the values of this parameter.
vScalefloatScale V coordinates 0 and the values of this parameter.
toLeftHandedboolif set to
truevertices and indices will be transformed to left handed. Default is false.lengthRingsintThe number of vertex rings added between the two hemispheres. Negative values are treated as 0.
Returns
- GeometricPrimitive
A capsule primitive.
New(float, float, int, float, float, bool)
Creates a sphere primitive.
public static GeometricMeshData<VertexPositionNormalTexture> New(float length, float radius, int tessellation, float uScale, float vScale, bool toLeftHanded)
Parameters
lengthfloatThe length of the capsule. That is the distance between the two sphere centers.
radiusfloatThe radius of the capsule.
tessellationintThe tessellation.
uScalefloatScale U coordinates between 0 and the values of this parameter.
vScalefloatScale V coordinates 0 and the values of this parameter.
toLeftHandedboolif set to
truevertices and indices will be transformed to left handed.
Returns
- GeometricMeshData<VertexPositionNormalTexture>
A sphere primitive.
Exceptions
- ArgumentOutOfRangeException
tessellation;Must be >= 3
New(float, float, int, float, float, bool, int)
Creates a capsule primitive with additional rings along its length.
public static GeometricMeshData<VertexPositionNormalTexture> New(float length = 1, float radius = 0.5, int tessellation = 8, float uScale = 1, float vScale = 1, bool toLeftHanded = false, int lengthRings = 0)
Parameters
lengthfloatThe length of the capsule. That is the distance between the two sphere centers.
radiusfloatThe radius of the capsule.
tessellationintThe tessellation.
uScalefloatScale U coordinates between 0 and the values of this parameter.
vScalefloatScale V coordinates 0 and the values of this parameter.
toLeftHandedboolif set to
truevertices and indices will be transformed to left handed. Default is false.lengthRingsintThe number of vertex rings added between the two hemispheres. Negative values are treated as 0.
Returns
- GeometricMeshData<VertexPositionNormalTexture>
A capsule primitive.