本文整理汇总了C#中PivotPosition类的典型用法代码示例。如果您正苦于以下问题:C# PivotPosition类的具体用法?C# PivotPosition怎么用?C# PivotPosition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PivotPosition类属于命名空间,在下文中一共展示了PivotPosition类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GenerateGeometry
/// <summary>
/// re/generate mesh geometry based on parameters
/// </summary>
/// <param name="radius0">fist radius of tube</param>
/// <param name="radius1">second radius of tube</param>
/// <param name="torusSegments">number of triangle of torusKnot</param>
/// <param name="coneSegments">number of triangle of torusKnot cone</param>
/// <param name="P">knot parameter</param>
/// <param name="Q">knot parameter</param>
/// <param name="normalsType">type of normals to be generated</param>
/// <param name="pivotPosition">position of the model pivot</param>
public void GenerateGeometry(float radius0, float radius1, int torusSegments, int coneSegments, int P, int Q, NormalsType normalsType, PivotPosition pivotPosition)
{
// generate new mesh and clear old one
var meshFilter = GetComponent<MeshFilter>();
if (meshFilter.sharedMesh == null)
{
meshFilter.sharedMesh = new Mesh();
}
var mesh = meshFilter.sharedMesh;
// generate geometry
GenerationTimeMS = Primitives.TorusKnotPrimitive.GenerateGeometry(mesh, radius0, radius1, torusSegments, coneSegments, P, Q, normalsType, pivotPosition);
this.radius0 = radius0;
this.radius1 = radius1;
this.torusSegments = torusSegments;
this.coneSegments = coneSegments;
this.P = P;
this.Q = Q;
this.normalsType = normalsType;
this.flipNormals = false;
this.pivotPosition = pivotPosition;
}
开发者ID:jfeng94,项目名称:Thesis,代码行数:36,代码来源:TorusKnot.cs
示例2: GenerateGeometry
/// <summary>
/// re/generate mesh geometry based on parameters
/// </summary>
/// <param name="radius0">fist radius of cone</param>
/// <param name="radius1">second radius of cone</param>
/// <param name="height">height of cone</param>
/// <param name="sides">number of triangle segments in radius</param>
/// <param name="heightSegments">number of triangle segments in height</param>
/// <param name="normalsType">type of normals to be generated</param>
/// <param name="pivotPosition">position of the model pivot</param>
/// <returns>Cone class with Cone game object</returns>
public void GenerateGeometry(float radius0, float radius1, float thickness, float height, int sides, int heightSegments, NormalsType normalsType, PivotPosition pivotPosition)
{
// generate new mesh and clear old one
var meshFilter = GetComponent<MeshFilter>();
if (meshFilter.sharedMesh == null)
{
meshFilter.sharedMesh = new Mesh();
}
var mesh = meshFilter.sharedMesh;
// generate geometry
if (thickness >= 0)
{
GenerationTimeMS = Primitives.HollowConePrimitive.GenerateGeometry(mesh, radius0, radius1, thickness, height, sides, heightSegments, normalsType, pivotPosition);
}
else
{
GenerationTimeMS = Primitives.ConePrimitive.GenerateGeometry(mesh, radius0, radius1, height, sides, heightSegments, normalsType, pivotPosition);
}
this.radius0 = radius0;
this.radius1 = radius1;
this.height = height;
this.thickness = thickness;
this.sides = sides;
this.heightSegments = heightSegments;
this.normalsType = normalsType;
this.flipNormals = false;
this.pivotPosition = pivotPosition;
}
开发者ID:jfeng94,项目名称:Thesis,代码行数:43,代码来源:Cone.cs
示例3: CreateGeometry
/// <summary>
/// Creates the geometry.
/// </summary>
protected void CreateGeometry(float radius0, float radius1, float thickness, float height, int sides,
int heightSegments, NormalsType normalsType, PivotPosition pivotPosition)
{
// Clear the old mesh and generate a new one.
var meshFilter = GetComponent<MeshFilter>();
if (meshFilter.sharedMesh == null)
{
meshFilter.sharedMesh = new Mesh();
}
var mesh = meshFilter.sharedMesh;
_meshGenerationTime = ShapesFactory.CreateDiamond(mesh, radius0, radius1, height, sides, heightSegments, normalsType, pivotPosition);
}
开发者ID:jaroosh,项目名称:Habitat,代码行数:15,代码来源:ShapeFixedRandom.cs
示例4: ElementPanel
public ElementPanel(ModelPanel modelPanel, PivotPosition position)
{
_modelPanel = modelPanel;
Position = position;
BackColor = Color.White;
DragEnter += new DragEventHandler(onDragEnter);
DragOver += new DragEventHandler(onDragOver);
DragDrop += new DragEventHandler(onDragDrop);
Paint += new PaintEventHandler(ElementPanel_Paint);
AutoScroll = true;
AllowDrop = true;
}
开发者ID:cnark,项目名称:Seal-Report,代码行数:13,代码来源:ElementPanel.cs
示例5: Create
/// <summary>
/// create Tube game object
/// </summary>
/// <param name="radius0">first radius of tube</param>
/// <param name="radius1">second radius of tube</param>
/// <param name="height">height of tube</param>
/// <param name="sides">number of triangle segments in radius direction</param>
/// <param name="heightSegments">number of triangle segments in height direction</param>
/// <returns>Tube class with Tube game object</returns>
/// <param name="slice">slicing parameter</param>
/// <param name="radialMapping">using radial uv mapping on the top/bottom of the tube</param>
/// <param name="normalsType">type of normals to be generated</param>
/// <param name="pivotPosition">position of the model pivot</param>
public static Tube Create(float radius0, float radius1, float height, int sides, int heightSegments, float slice, bool radialMapping, NormalsType normalsType, PivotPosition pivotPosition)
{
var cylinderObject = new GameObject("TubePro");
cylinderObject.AddComponent<MeshFilter>();
var renderer = cylinderObject.AddComponent<MeshRenderer>();
renderer.sharedMaterial = new Material(Shader.Find("Diffuse"));
var tube = cylinderObject.AddComponent<Tube>();
tube.GenerateGeometry(radius0, radius1, height, sides, heightSegments, slice, radialMapping, normalsType, pivotPosition);
return tube;
}
开发者ID:pisipo,项目名称:CTB,代码行数:27,代码来源:Tube.cs
示例6: Create
/// <summary>
/// create Box game object
/// </summary>
/// <param name="width">width of cube</param>
/// <param name="height">height of cube</param>
/// <param name="depth">depth of cube</param>
/// <param name="widthSegments">number of triangle segments in width direction</param>
/// <param name="heightSegments">number of triangle segments in height direction</param>
/// <param name="depthSegments">number of triangle segments in depth direction</param>
/// <param name="pivot">position of the model pivot</param>
/// <param name="cubeMap">enable 6-sides cube map uv mapping</param>
/// <returns>Box class with Box game object</returns>
public static Box Create(float width, float height, float depth, int widthSegments, int heightSegments, int depthSegments, bool cubeMap, PivotPosition pivot)
{
var planeObject = new GameObject("BoxPro");
planeObject.AddComponent<MeshFilter>();
var renderer = planeObject.AddComponent<MeshRenderer>();
renderer.sharedMaterial = new Material(Shader.Find("Diffuse"));
var cube = planeObject.AddComponent<Box>();
cube.GenerateGeometry(width, height, depth, widthSegments, heightSegments, depthSegments, cubeMap, pivot);
return cube;
}
开发者ID:pisipo,项目名称:CTB,代码行数:26,代码来源:Box.cs
示例7: Create
/// <summary>
/// create RoundedCube game object
/// </summary>
/// <param name="width">width of the cube</param>
/// <param name="height">height of the cube</param>
/// <param name="length">length of the cube</param>
/// <param name="segments">number of segments</param>
/// <param name="roundness">roudness coefficient</param>
/// <param name="normals">type of normals to be generated</param>
/// <param name="pivotPosition">position of the model pivot</param>
/// <returns>RoundedCube class with RoundedCube game object</returns>
public static RoundedCube Create(float width, float height, float length, int segments, float roundness, NormalsType normals, PivotPosition pivotPosition)
{
var sphereObject = new GameObject("RoundedCubePro");
sphereObject.AddComponent<MeshFilter>();
var renderer = sphereObject.AddComponent<MeshRenderer>();
renderer.sharedMaterial = new Material(Shader.Find("Diffuse"));
var superellipsoid = sphereObject.AddComponent<RoundedCube>();
superellipsoid.GenerateGeometry(width, height, length, segments, roundness, normals, pivotPosition);
return superellipsoid;
}
开发者ID:jfeng94,项目名称:Thesis,代码行数:25,代码来源:RoundedCube.cs
示例8: Create
/// <summary>
/// create Sphere game object
/// </summary>
/// <param name="radius">radius of sphere</param>
/// <param name="segments">number of segments</param>
/// <param name="hemisphere">hemisphere, 0 ... complete sphere, 0.5 ... half-sphere</param>
/// <param name="normals">type of normals to be generated</param>
/// <param name="pivotPosition">position of the model pivot</param>
/// <param name="innerRadius">radius of the inner sphere</param>
/// <param name="slice">vertical slice parameter</param>
/// <returns>Sphere class with Sphere game object</returns>
public static Sphere Create(float radius, int segments, float hemisphere, float innerRadius, float slice, NormalsType normals, PivotPosition pivotPosition)
{
var sphereObject = new GameObject("SpherePro");
sphereObject.AddComponent<MeshFilter>();
var renderer = sphereObject.AddComponent<MeshRenderer>();
renderer.sharedMaterial = new Material(Shader.Find("Diffuse"));
var sphere = sphereObject.AddComponent<Sphere>();
sphere.GenerateGeometry(radius, segments, hemisphere, innerRadius, slice, normals, pivotPosition);
return sphere;
}
开发者ID:jaroosh,项目名称:Habitat,代码行数:25,代码来源:Sphere.cs
示例9: Create
/// <summary>
/// create TorusKnot game object
/// </summary>
/// <param name="radius0">first radius of tube</param>
/// <param name="radius1">second radius of tube</param>
/// <param name="torusSegments">number of triangle segments of torusKnot</param>
/// <param name="coneSegments">number of triangle segments or torusKnot cone</param>
/// <returns>TorusKnot class with TorusKnot game object</returns>
/// <param name="P">knot parameter</param>
/// <param name="Q">knot parameter</param>
/// <param name="normalsType">type of normals to be generated</param>
/// <param name="pivotPosition">position of the model pivot</param>
public static TorusKnot Create(float radius0, float radius1, int torusSegments, int coneSegments, int P, int Q, NormalsType normalsType, PivotPosition pivotPosition)
{
var cylinderObject = new GameObject("TorusKnotPro");
cylinderObject.AddComponent<MeshFilter>();
var renderer = cylinderObject.AddComponent<MeshRenderer>();
renderer.sharedMaterial = new Material(Shader.Find("Diffuse"));
var torusKnot = cylinderObject.AddComponent<TorusKnot>();
torusKnot.GenerateGeometry(radius0, radius1, torusSegments, coneSegments, P, Q, normalsType, pivotPosition);
return torusKnot;
}
开发者ID:jaroosh,项目名称:Habitat,代码行数:26,代码来源:TorusKnot.cs
示例10: Create
/// <summary>
/// create GeoSphere game object
/// </summary>
/// <param name="radius">radius of sphere</param>
/// <param name="subdivision">number of subdivision</param>
/// <param name="baseType">type of generation primitive</param>
/// <param name="normals">type of normals to be generated</param>
/// <param name="pivotPosition">position of the model pivot</param>
/// <returns>GeoSphere class with GeoSphere game object</returns>
public static GeoSphere Create(float radius, int subdivision, Primitives.GeoSpherePrimitive.BaseType baseType, NormalsType normals, PivotPosition pivotPosition)
{
var sphereObject = new GameObject("GeoSpherePro");
sphereObject.AddComponent<MeshFilter>();
var renderer = sphereObject.AddComponent<MeshRenderer>();
renderer.sharedMaterial = new Material(Shader.Find("Diffuse"));
var sphere = sphereObject.AddComponent<GeoSphere>();
sphere.GenerateGeometry(radius, subdivision, baseType, normals, pivotPosition);
return sphere;
}
开发者ID:jfeng94,项目名称:Thesis,代码行数:23,代码来源:GeoSphere.cs
示例11: Create
/// <summary>
/// create Cone game object
/// </summary>
/// <param name="radius0">first radius of cone</param>
/// <param name="radius1">second radius of cone</param>
/// <param name="thickness">thickness</param>
/// <param name="height">height of cone</param>
/// <param name="sides">number of triangle segments in radius direction</param>
/// <param name="heightSegments">number of triangle segments in height direction</param>
/// <param name="normalsType">type of normals to be generated</param>
/// <param name="pivotPosition">position of the model pivot</param>
/// <returns>Cone class with Cone game object</returns>
public static Cone Create(float radius0, float radius1, float thickness, float height, int sides, int heightSegments, NormalsType normalsType, PivotPosition pivotPosition)
{
var cylinderObject = new GameObject("ConePro");
cylinderObject.AddComponent<MeshFilter>();
var renderer = cylinderObject.AddComponent<MeshRenderer>();
renderer.sharedMaterial = new Material(Shader.Find("Diffuse"));
var cone = cylinderObject.AddComponent<Cone>();
cone.GenerateGeometry(radius0, radius1, thickness, height, sides, heightSegments, normalsType, pivotPosition);
return cone;
}
开发者ID:jfeng94,项目名称:Thesis,代码行数:26,代码来源:Cone.cs
示例12: Create
/// <summary>
/// create Pyramid game object
/// </summary>
/// <param name="width">width of pyramid</param>
/// <param name="height">height of pyramid</param>
/// <param name="depth">depth of pyramid</param>
/// <param name="widthSegments">number of triangle segments in width direction</param>
/// <param name="heightSegments">number of triangle segments in height direction</param>
/// <param name="depthSegments">number of triangle segments in depth direction</param>
/// <param name="pivotPosition">position of the model pivot</param>
/// <param name="pyramidMap">enable pyramid map uv mapping</param>
/// <returns>Pyramid class with Pyramid game object</returns>
public static Pyramid Create(float width, float height, float depth, int widthSegments, int heightSegments, int depthSegments, bool pyramidMap, PivotPosition pivotPosition)
{
var planeObject = new GameObject("PyramidPro");
planeObject.AddComponent<MeshFilter>();
var renderer = planeObject.AddComponent<MeshRenderer>();
renderer.sharedMaterial = new Material(Shader.Find("Diffuse"));
var pyramid = planeObject.AddComponent<Pyramid>();
pyramid.GenerateGeometry(width, height, depth, widthSegments, heightSegments, depthSegments, pyramidMap, pivotPosition);
return pyramid;
}
开发者ID:jaroosh,项目名称:Habitat,代码行数:26,代码来源:Pyramid.cs
示例13: Create
/// <summary>
/// create Cylinder game object
/// </summary>
/// <param name="radius">radius of cylinder</param>
/// <param name="height">height of cylinder</param>
/// <param name="sides">number of triangle segments in radius direction</param>
/// <param name="heightSegments">number of triangle segments in height direction</param>
/// <returns>Cylinder class with Cylinder game object</returns>
/// <param name="pivotPosition">position of the model pivot</param>
/// <param name="normals">type of normals to be generated</param>
public static Cylinder Create(float radius, float height, int sides, int heightSegments, NormalsType normals, PivotPosition pivotPosition)
{
var cylinderObject = new GameObject("CylinderPro");
cylinderObject.AddComponent<MeshFilter>();
var renderer = cylinderObject.AddComponent<MeshRenderer>();
renderer.sharedMaterial = new Material(Shader.Find("Diffuse"));
var cylinder = cylinderObject.AddComponent<Cylinder>();
cylinder.GenerateGeometry(radius, height, sides, heightSegments, normals, pivotPosition);
return cylinder;
}
开发者ID:pisipo,项目名称:CTB,代码行数:24,代码来源:Cylinder.cs
示例14: Create
/// <summary>
/// create SuperEllipsoid game object
/// </summary>
/// <param name="width">width of the cube</param>
/// <param name="height">height of the cube</param>
/// <param name="length">length of the cube</param>
/// <param name="segments">number of segments</param>
/// <param name="normals">type of normals to be generated</param>
/// <param name="pivotPosition">position of the model pivot</param>
/// <param name="n1">first parameter</param>
/// <param name="n2">second parameter</param>
/// <returns>SuperEllipsoid class with SuperEllipsoid game object</returns>
public static SuperEllipsoid Create(float width, float height, float length, int segments, float n1, float n2, NormalsType normals, PivotPosition pivotPosition)
{
var sphereObject = new GameObject("SuperEllipsoidPro");
sphereObject.AddComponent<MeshFilter>();
var renderer = sphereObject.AddComponent<MeshRenderer>();
renderer.sharedMaterial = new Material(Shader.Find("Diffuse"));
var roundedCube = sphereObject.AddComponent<SuperEllipsoid>();
roundedCube.GenerateGeometry(width, height, length, segments, n1, n2, normals, pivotPosition);
return roundedCube;
}
开发者ID:jimbo00000,项目名称:SeaSnake,代码行数:26,代码来源:SuperEllispoid.cs
示例15: Create
/// <summary>
/// create Capsule game object
/// </summary>
/// <param name="radius">radius of capsule</param>
/// <param name="sides">number of segments</param>
/// <param name="heightSegments">number of segments of central cylinder</param>
/// <param name="normals">type of normals to be generated</param>
/// <param name="pivotPosition">position of the model pivot</param>
/// <returns>Capsule class with Capsule game object</returns>
public static Capsule Create(float radius, float height, int sides, int heightSegments, bool preserveHeight, NormalsType normals, PivotPosition pivotPosition)
{
var capsuleObject = new GameObject("CapsulePro");
capsuleObject.AddComponent<MeshFilter>();
var renderer = capsuleObject.AddComponent<MeshRenderer>();
renderer.sharedMaterial = new Material(Shader.Find("Diffuse"));
var capsule = capsuleObject.AddComponent<Capsule>();
capsule.GenerateGeometry(radius, height, sides, heightSegments, preserveHeight, normals, pivotPosition);
return capsule;
}
开发者ID:jimbo00000,项目名称:SeaSnake,代码行数:23,代码来源:Capsule.cs
示例16: Create
/// <summary>
/// create Arc game object
/// </summary>
/// <param name="width">width of cube</param>
/// <param name="height1">height1 of cube</param>
/// <param name="height2">height2 of cube</param>
/// <param name="depth">depth of cube</param>
/// <param name="arcSegments">depth of the </param>
/// <param name="pivot">position of the model pivot</param>
/// <returns>Arc class with Arc game object</returns>
public static Arc Create(float width, float height1, float height2, float depth, int arcSegments, PivotPosition pivot)
{
var planeObject = new GameObject("ArcPro");
planeObject.AddComponent<MeshFilter>();
var renderer = planeObject.AddComponent<MeshRenderer>();
renderer.sharedMaterial = new Material(Shader.Find("Diffuse"));
var cube = planeObject.AddComponent<Arc>();
cube.gizmo = ArcGizmo.Create();
cube.gizmo.transform.parent = planeObject.transform;
cube.GenerateGeometry(width, height1, height2, depth, arcSegments, pivot);
return cube;
}
开发者ID:pisipo,项目名称:CTB,代码行数:27,代码来源:Arc.cs
示例17: GenerateGeometry
/// <summary>
/// create SphericalCone game object
/// </summary>
/// <param name="radius">radius of sphere</param>
/// <param name="segments">number of segments</param>
/// <param name="coneAngle">angle of conus in DEG, 360 ... complete sphere, 180 ... half-sphere</param>
/// <param name="normalsType">type of normals to be generated</param>
/// <param name="pivotPosition">position of the model pivot</param>
public void GenerateGeometry(float radius, int segments, float coneAngle, NormalsType normalsType, PivotPosition pivotPosition)
{
// generate new mesh and clear old one
var meshFilter = GetComponent<MeshFilter>();
if (meshFilter.sharedMesh == null)
{
meshFilter.sharedMesh = new Mesh();
}
var mesh = meshFilter.sharedMesh;
// generate geometry
GenerationTimeMS = Primitives.SphericalConePrimitive.GenerateGeometry(mesh, radius, segments, coneAngle, normalsType, pivotPosition);
this.radius = radius;
this.segments = segments;
this.coneAngle = coneAngle;
this.normalsType = normalsType;
this.flipNormals = false;
this.pivotPosition = pivotPosition;
}
开发者ID:jfeng94,项目名称:Thesis,代码行数:30,代码来源:SphericalCone.cs
示例18: GenerateGeometry
/// <summary>
/// create GeoSphere game object
/// </summary>
/// <param name="radius">radius of sphere</param>
/// <param name="subdivision">number of subdivision</param>
/// <param name="baseType">type of generation primitive</param>
/// <param name="normalsType">type of normals to be generated</param>
/// <param name="pivotPosition">position of the model pivot</param>
public void GenerateGeometry(float radius, int subdivision, Primitives.GeoSpherePrimitive.BaseType baseType, NormalsType normalsType, PivotPosition pivotPosition)
{
// generate new mesh and clear old one
var meshFilter = GetComponent<MeshFilter>();
if (meshFilter.sharedMesh == null)
{
meshFilter.sharedMesh = new Mesh();
}
var mesh = meshFilter.sharedMesh;
// geneate geometry
GenerationTimeMS = Primitives.GeoSpherePrimitive.GenerateGeometry(mesh, radius, subdivision, baseType, normalsType, pivotPosition);
this.radius = radius;
this.subdivision = subdivision;
this.baseType = baseType;
this.normalsType = normalsType;
this.flipNormals = false;
this.pivotPosition = pivotPosition;
}
开发者ID:jfeng94,项目名称:Thesis,代码行数:30,代码来源:GeoSphere.cs
示例19: GenerateGeometry
/// <summary>
/// create Ellipsoid game object
/// </summary>
/// <param name="width">width of ellipsoid</param>
/// <param name="height">height of ellipsoid</param>
/// <param name="length">length of ellipsoid</param>
/// <param name="segments">number of segments</param>
/// <param name="normalsType">type of normals to be generated</param>
/// <param name="pivotPosition">position of the model pivot</param>
public void GenerateGeometry(float width, float height, float length, int segments, NormalsType normalsType, PivotPosition pivotPosition)
{
// generate new mesh and clear old one
var meshFilter = GetComponent<MeshFilter>();
if (meshFilter.sharedMesh == null)
{
meshFilter.sharedMesh = new Mesh();
}
var mesh = meshFilter.sharedMesh;
// generate geometry
GenerationTimeMS = Primitives.EllipsoidPrimitive.GenerateGeometry(mesh, width, height, length, segments, normalsType, pivotPosition);
this.width = width;
this.height = height;
this.length = length;
this.segments = segments;
this.normalsType = normalsType;
this.flipNormals = false;
this.pivotPosition = pivotPosition;
}
开发者ID:jfeng94,项目名称:Thesis,代码行数:32,代码来源:Ellipsoid.cs
示例20: GenerateGeometry
/// <summary>
/// re/generate mesh geometry based on parameters
/// </summary>
/// <param name="radius">radius of cylinder</param>
/// <param name="height">height of cylinder</param>
/// <param name="sides">number of triangle segments in radius</param>
/// <param name="heightSegments">number of triangle segments in height</param>
/// <param name="pivotPosition">position of the model pivot</param>
/// <param name="normalsType">type of normals to be generated</param>
public void GenerateGeometry(float radius, float height, int sides, int heightSegments, NormalsType normalsType, PivotPosition pivotPosition)
{
// generate new mesh and clear old one
var meshFilter = GetComponent<MeshFilter>();
if (meshFilter.sharedMesh == null)
{
meshFilter.sharedMesh = new Mesh();
}
var mesh = meshFilter.sharedMesh;
// generate cone with same radiuses
GenerationTimeMS = Primitives.ConePrimitive.GenerateGeometry(mesh, radius, radius, height, sides, heightSegments, normalsType, pivotPosition);
this.radius = radius;
this.height = height;
this.sides = sides;
this.heightSegments = heightSegments;
this.normalsType = normalsType;
this.flipNormals = false;
this.pivotPosition = pivotPosition;
}
开发者ID:jfeng94,项目名称:Thesis,代码行数:32,代码来源:Cylinder.cs
注:本文中的PivotPosition类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论