本文整理汇总了C#中AxisType类的典型用法代码示例。如果您正苦于以下问题:C# AxisType类的具体用法?C# AxisType怎么用?C# AxisType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AxisType类属于命名空间,在下文中一共展示了AxisType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: LineChart
public LineChart(ChartSize size, ChartData data, AxisType axisTypes, AxisLabels labels, AxisRange ranges)
: base(LineTypeDefinition, size, data)
{
_labels = labels;
_axisType = axisTypes;
_ranges = ranges;
}
开发者ID:pachman,项目名称:ngchart,代码行数:7,代码来源:LineChart.cs
示例2: Axis2Direction
public static Vector3 Axis2Direction(Transform transform, AxisType axisType)
{
if (AxisType.UP == axisType)
{
return transform.up;
}
else if (AxisType.DOWN == axisType)
{
return -transform.up;
}
else if (AxisType.LEFT == axisType)
{
return -transform.right;
}
else if (AxisType.RIGHT == axisType)
{
return transform.right;
}
else if (AxisType.FORWARD == axisType)
{
return transform.forward;
}
return -transform.forward;
}
开发者ID:SBStudio,项目名称:MagicCube,代码行数:25,代码来源:AxisUtil.cs
示例3: FindGizmoTranslationPlane
public Plane FindGizmoTranslationPlane(Ray pickRay, AxisType translationAxis)
{
Vector3 vPos = Selected.DerivedPosition;
Vector3 vCamBack = ActiveViewport.CameraEditor.Camera.DerivedDirection;
vCamBack = -vCamBack;
if (translationAxis == AxisType.None)
return new Plane(vCamBack, vPos);
Quaternion qOrient = Selected.DerivedOrientation;
Plane planeX = new Plane(qOrient.XAxis, vPos);
Plane planeY = new Plane(qOrient.YAxis, vPos);
Plane planeZ = new Plane(qOrient.ZAxis, vPos);
float vX = planeX.ProjectVector(pickRay.Direction).Length;
float vY = planeY.ProjectVector(pickRay.Direction).Length;
float vZ = planeZ.ProjectVector(pickRay.Direction).Length;
if ((int)(translationAxis & AxisType.X) != 0)
vX = 10000.0f;
if ((int)(translationAxis & AxisType.Y) != 0)
vY = 10000.0f;
if ((int)(translationAxis & AxisType.Z) != 0)
vZ = 10000.0f;
if (vX < vY && vX < vZ)
return planeX;
else
{
if (vY < vX && vY < vZ)
return planeY;
else
return planeZ;
}
}
开发者ID:andyhebear,项目名称:likeleon,代码行数:35,代码来源:MogitorsRoot.Gizmo.cs
示例4: SetAxis
public void SetAxis(AxisType axis, float val)
{
if( axisValues == null )
axisValues = new float[System.Enum.GetValues(typeof(AxisType)).Length];
axisValues[(int)axis] = val;
}
开发者ID:bzgeb,项目名称:unity-input,代码行数:7,代码来源:InputState.cs
示例5: GetAxis
public float GetAxis(AxisType axis)
{
if( axisValues == null )
axisValues = new float[System.Enum.GetValues(typeof(AxisType)).Length];
return axisValues[(int)axis];
}
开发者ID:bzgeb,项目名称:unity-input,代码行数:7,代码来源:InputState.cs
示例6: GetAxis
protected float GetAxis(string axisName, AxisType type = AxisType.Normal)
{
float value = 0f;
value = type == AxisType.Normal ? Input.GetAxis(axisName) : Input.GetAxisRaw(axisName);
return value;
}
开发者ID:GR-2015,项目名称:Heasmodex,代码行数:8,代码来源:BaseInputSource.cs
示例7: DirectXControllerAxis
public DirectXControllerAxis(DirectXControllerInterface controllerInterface, AxisType type, int axisNumber, JoystickState initialState)
{
_axisType = type;
_axisNumber = axisNumber;
_value = new HeliosValue(controllerInterface, new BindingValue(GetValue(initialState)), "", Name, "Current value for " + Name + ".", "(0 - 65536)", BindingValueUnits.Numeric);
_triggers.Add(_value);
}
开发者ID:Heliflyer,项目名称:helios,代码行数:8,代码来源:DirectXControllerAxis.cs
示例8: Axis
// constructor
internal Axis(AxisType axistype, AstNode input) {
_axistype = axistype;
_input = input;
_prefix = String.Empty;
_name = String.Empty;
_nodetype = XPathNodeType.All;
this.abbrAxis = true;
}
开发者ID:cornelius90,项目名称:InnovatorAdmin,代码行数:9,代码来源:axis.cs
示例9: Axis
// constructor
public Axis(AxisType axisType, AstNode input, string prefix, string name, XPathNodeType nodetype) {
Debug.Assert(prefix != null);
Debug.Assert(name != null);
this.axisType = axisType;
this.input = input;
this.prefix = prefix;
this.name = name;
this.nodeType = nodetype;
}
开发者ID:uQr,项目名称:referencesource,代码行数:10,代码来源:Axis.cs
示例10: Axis
public Axis(AxisType axisType, AstNode input, string prefix, string name, XPathNodeType nodetype)
{
this.urn = string.Empty;
this.axisType = axisType;
this.input = input;
this.prefix = prefix;
this.name = name;
this.nodeType = nodetype;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:Axis.cs
示例11: Axis
// constructor
public Axis(AxisType axisType, AstNode input, string prefix, string name, XPathNodeType nodetype)
{
Debug.Assert(prefix != null);
Debug.Assert(name != null);
_axisType = axisType;
_input = input;
_prefix = prefix;
_name = name;
_nodeType = nodetype;
}
开发者ID:noahfalk,项目名称:corefx,代码行数:11,代码来源:Axis.cs
示例12: GetAxis
public bool windowsOnly = false; //use this for OS-specific config
#endregion Fields
#region Methods
public string GetAxis(AxisType axisType)
{
foreach(AxisMapping mapping in axisMappings)
{
if( mapping.target == axisType )
return mapping.axis;
}
return "";
}
开发者ID:bzgeb,项目名称:unity-input,代码行数:16,代码来源:InputDeviceConfig.cs
示例13: InputAxisMap
/// <summary>
/// Creates a new InputAxisMap
/// </summary>
/// <param name="MouseButton">
/// The key that will trigger this action
/// </param>
public InputAxisMap(AxisType triggerType, object trigger, AxisType? secondTriggerType = null, object secondTrigger = null)
{
TriggerType = triggerType;
Trigger = trigger; ;
if (secondTrigger != null)
{
SecondTriggerType = secondTriggerType.Value;
SecondTrigger = secondTrigger;
} else
SecondTriggerType = AxisType.None;
}
开发者ID:kourbou,项目名称:Pixel,代码行数:18,代码来源:InputAxisMap.cs
示例14: Axis
public Axis(GraphPane pane)
{
mPane = pane;
mMaximum = 0;
mMinimum = 0;
mScale = 1.0f;
mTitle = new AxisTitle();
mLabels = new AxisLabels();
mMajorMark = new AxisMark(15.0f);
mMinorMark = new AxisMark(6.0f);
mAxisType = AxisType.Linear;
mPen = SystemPens.ControlText;
}
开发者ID:eprimo,项目名称:Linc-Reporting-Service,代码行数:13,代码来源:Axis.cs
示例15: GetRollAxis
public static void GetRollAxis(Transform transform,
Vector3 right,
Vector3 forward,
out AxisType rightAxis,
out AxisType upAxis,
out AxisType forwardAxis)
{
Vector3 r = default(Vector3), u = default(Vector3), f = default(Vector3);
List<Vector3> axisList = new List<Vector3>()
{
transform.right,
transform.up,
transform.forward
};
for (int i = axisList.Count; --i >= 0;)
{
if (default(Vector3) == r)
{
r = axisList[i];
continue;
}
float project1 = Vector3.Project(right, r).magnitude;
float project2 = Vector3.Project(right, axisList[i]).magnitude;
r = project1 > project2 ? r : axisList[i];
}
axisList.Remove(r);
for (int i = axisList.Count; --i >= 0;)
{
if (default(Vector3) == f)
{
f = axisList[i];
continue;
}
float project1 = Vector3.Project(forward, f).magnitude;
float project2 = Vector3.Project(forward, axisList[i]).magnitude;
f = project1 > project2 ? f : axisList[i];
}
axisList.Remove(f);
u = axisList[0];
rightAxis = Direction2Axis(transform, r);
upAxis = Direction2Axis(transform, u);
forwardAxis = Direction2Axis(transform, f);
}
开发者ID:SBStudio,项目名称:MagicCube,代码行数:51,代码来源:AxisUtil.cs
示例16: Axis
/// <summary>
/// Index the Axes collection to get an axis
/// </summary>
/// <param name="type">Specifies the axis to return.</param>
/// <param name="group">Specifies the axis group. If this argument is omitted, the primary group is used. 3-D charts have only one axis group.</param>
/// <returns></returns>
public Axis this[AxisType type, AxisGroup group]
{
get
{
try
{
return new Axis(InternalObject.GetType().InvokeMember("Item", System.Reflection.BindingFlags.InvokeMethod, null, InternalObject, new object[] { (int)type, (int)group }));
}
catch (Exception ex)
{
throw new IndexOutOfRangeException(String.Concat("Could not find axis '", type, "', '", group, "'."), ex);
}
}
}
开发者ID:dixonte,项目名称:STC.Automation.Office,代码行数:20,代码来源:Axes.cs
示例17: SetCube
public void SetCube(CubeItem cube, AxisType rightAxis, AxisType upAxis, AxisType forwardAxis)
{
this.cube = cube;
this.rightAxis = rightAxis;
this.upAxis = upAxis;
this.forwardAxis = forwardAxis;
Vector3 forward = AxisUtil.Axis2Direction(cube.transform, forwardAxis);
Vector3 right = AxisUtil.Axis2Direction(cube.transform, rightAxis);
Vector3 up = AxisUtil.Axis2Direction(cube.transform, upAxis);
transform.SetParent(cube.transform);
transform.rotation = Quaternion.LookRotation(forward, up);
transform.position = cube.transform.position + transform.up * cube.size * 0.5f;
}
开发者ID:SBStudio,项目名称:MagicCube,代码行数:15,代码来源:Player.cs
示例18: AxisData
public AxisType type; //受け取る軸の種類
#endregion Fields
#region Constructors
//コンストラクタ
public AxisData()
{
name = "";
descriptiveName = "";
descriptiveNegativeName = "";
negativeButton = "";
positiveButton = "";
altNegativeButton = "";
altPositiveButton = "";
gravity = 0;
dead = 0;
sensitivity = 0;
snap = false;
invert = false;
type = AxisType.KeyOrMouseButton;
axis = 1;
joyNum = 0;
}
开发者ID:InagakiTatuya,项目名称:NKC_GlideRace,代码行数:25,代码来源:InputManagerGenerator.cs
示例19: GetAxisRaw
public float GetAxisRaw(AxisType axisType)
{
string axisStr = config.GetAxis(axisType);
if( axisStr == "" )
return 0;
if( config.isJoystick )
{
axisStr = axisStr.Replace("#",deviceId.ToString());
return Input.GetAxisRaw(axisStr);
}
else
{
string[] axisStringSplit = axisStr.Split(' ');
int axisVal = 0;
if( Input.GetKey(axisStringSplit[0]) )
axisVal++;
if( Input.GetKey(axisStringSplit[1]) )
axisVal--;
return axisVal;
}
}
开发者ID:bzgeb,项目名称:unity-input,代码行数:22,代码来源:InputDevice.cs
示例20: UpdateAxisSmooth
void UpdateAxisSmooth(AxisType axis)
{
float lastVal = lastState.GetAxis(axis);
float currentVal = GetAxisRaw(axis);
currentVal = Mathf.InverseLerp(config.deadZone,1,Mathf.Abs(currentVal)) * Mathf.Sign(currentVal); // apply dead zone (todo: radial dead zone based on 2d distance)
float maxDelta = Time.deltaTime*config.sensitivity;
if( Mathf.Sign(lastVal) != Mathf.Sign(currentVal)) // move faster towards zero
maxDelta *= 2;
currentVal = Mathf.Clamp( lastVal + Mathf.Clamp(currentVal-lastVal,-maxDelta,maxDelta), -1, 1 );
currentState.SetAxis(axis,currentVal);
}
开发者ID:bzgeb,项目名称:unity-input,代码行数:15,代码来源:InputDevice.cs
注:本文中的AxisType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论