本文整理汇总了C#中Mapping.normalize方法的典型用法代码示例。如果您正苦于以下问题:C# Mapping.normalize方法的具体用法?C# Mapping.normalize怎么用?C# Mapping.normalize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mapping
的用法示例。
在下文中一共展示了Mapping.normalize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
//.........这里部分代码省略.........
// JointConstraint.Operators.LESS_THAN,
// new Vector3(-2.0f, 10.0f, 10.0f) ) );
// ok
// Gesture left_hand_right = new Gesture("left-hand-right", (int)ActionManager.actions.handRight);
// left_hand_right.constraints.Add ( new JointConstraint(this,
// Joints.HAND_LEFT,
// Joints.SHOULDER_LEFT,
// JointConstraint.Relations.COMPONENT_DISTANCE,
// JointConstraint.Operators.GREATER_THAN,
// new Vector3(1.0f, -10.0f, -10.0f) ) );
// ok
Gesture right_hand_up = new Gesture("right-hand-up", (int)ActionManager.actions.handUp);
right_hand_up.constraints.Add( new JointConstraint(this,
Joints.HAND_RIGHT,
Joints.SHOULDER_RIGHT,
JointConstraint.Relations.COMPONENT_DISTANCE,
JointConstraint.Operators.GREATER_THAN,
new Vector3(-10.0f, 1.2f, -10.0f) ) );
// ok
// Gesture right_hand_left = new Gesture("right-hand-left", (int)ActionManager.actions.handLeft);
// right_hand_left.constraints.Add ( new JointConstraint(this,
// Joints.HAND_RIGHT,
// Joints.SHOULDER_RIGHT,
// JointConstraint.Relations.COMPONENT_DISTANCE,
// JointConstraint.Operators.LESS_THAN,
// new Vector3(-1.0f, 10.0f, 10.0f) ) );
// // ok
// Gesture right_hand_right = new Gesture("right-hand-right", (int)ActionManager.actions.handRight);
// right_hand_right.constraints.Add ( new JointConstraint(this,
// Joints.HAND_RIGHT,
// Joints.SHOULDER_RIGHT,
// JointConstraint.Relations.COMPONENT_DISTANCE,
// JointConstraint.Operators.GREATER_THAN,
// new Vector3(2.0f, -10.0f, -10.0f) ) );
// Gesture super_charge_charging = new Gesture("super-charge-charging", (int)ActionManager.actions.superShoot);
// super_charge_charging.constraints.Add ( new JointConstraint(this,
// Joints.HAND_LEFT,
// Joints.SHOULDER_LEFT,
// JointConstraint.Relations.DISTANCE,
// JointConstraint.Operators.LESS_THAN,
// new Vector3(4.0f, 0.0f, 0.0f) ) );
// super_charge_charging.constraints.Add( new JointConstraint(this,
// Joints.HAND_RIGHT,
// Joints.SHOULDER_RIGHT,
// JointConstraint.Relations.COMPONENT_DISTANCE,
// JointConstraint.Operators.GREATER_THAN,
// new Vector3(-10.0f, 1.2f, -10.0f) ) );
// gestures.Add("super-charge-charging", super_charge_charging);
// gestures to handle either left knee raised or right knee raised
Gesture switch_places_ll = new Gesture("switch-places-left-leg", (int)ActionManager.actions.switchPlaces);
switch_places_ll.constraints.Add( new JointConstraint(this,
Joints.KNEE_LEFT,
Joints.HIP_CENTER,
JointConstraint.Relations.COMPONENT_DISTANCE,
JointConstraint.Operators.GREATER_THAN,
new Vector3(-10.0f, -3.0f, -10.0f) ) );
Gesture switch_places_rl = new Gesture("switch-places-right-leg", (int)ActionManager.actions.switchPlaces);
switch_places_rl.constraints.Add( new JointConstraint(this,
Joints.KNEE_RIGHT,
Joints.HIP_CENTER,
JointConstraint.Relations.COMPONENT_DISTANCE,
JointConstraint.Operators.GREATER_THAN,
new Vector3(-10.0f, -3.0f, -10.0f) ) );
// AnimatedGesture stupid_wave = new AnimatedGesture("stupid-wave", 2);
// stupid_wave.add_keyframe(right_hand, 1.0f, 0.0f);
// stupid_wave.add_keyframe(left_hand, 1.0f, 0.0f);
// animated_gestures.Add("stupid-wave", stupid_wave);
// 2
gestures.Add("switch-places-ll", switch_places_ll);
gestures.Add("switch-places-rl", switch_places_rl);
// gestures.Add( "left-hand-up", left_hand_up );
gestures.Add("right-hand-up", right_hand_up);
// 4
// gestures.Add ("left-hand-left", left_hand_left);
// gestures.Add ("right-hand-left", right_hand_left);
// gestures.Add ("left-hand-right", left_hand_right);
// gestures.Add ("right-hand-right", right_hand_right);
Mapping aim_x = new Mapping(this, Joints.HAND_LEFT, new Vector3(1, 0, 0));
aim_x.push_joint(Joints.HIP_CENTER, new Vector3(1, 0, 0), Mapping.Operators.SUBTRACT);
aim_x.set_bound(4.5f);
aim_x.normalize();
mappings.Add("aim_x", aim_x );
Mapping aim_y = new Mapping(this, Joints.HAND_LEFT, new Vector3(0, 1, 0));
aim_y.push_joint(Joints.SHOULDER_RIGHT, new Vector3(0, 1, 0), Mapping.Operators.SUBTRACT);
aim_y.set_bound(4.5f);
aim_y.normalize();
mappings.Add("aim_y", aim_y );
}