当前位置: 首页>>代码示例>>C#>>正文


C# Pose类代码示例

本文整理汇总了C#中Pose的典型用法代码示例。如果您正苦于以下问题:C# Pose类的具体用法?C# Pose怎么用?C# Pose使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Pose类属于命名空间,在下文中一共展示了Pose类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DumpContactSetSample

    public DumpContactSetSample(Microsoft.Xna.Framework.Game game)
      : base(game)
    {
      GraphicsScreen.ClearBackground = true;

      // Create two collision objects with triangle mesh shapes.
      var meshA = new SphereShape(1).GetMesh(0.01f, 4);
      var shapeA = new TriangleMeshShape(meshA, true) { Partition = new CompressedAabbTree() };
      var poseA = new Pose(new Vector3F(-1, 0, 0), RandomHelper.Random.NextQuaternionF());
      var collisionObjectA = new CollisionObject(new GeometricObject(shapeA, poseA));

      var meshB = new BoxShape(0.2f, 2, 1f).GetMesh(0.01f, 4);
      var shapeB = new TriangleMeshShape(meshB, true) { Partition = new CompressedAabbTree() };
      var poseB = new Pose(new Vector3F(0.1f, 0, 0), RandomHelper.Random.NextQuaternionF());
      var collisionObjectB = new CollisionObject(new GeometricObject(shapeB, poseB));

      // Explicitly create a contact set. (Normally you would get the contact set
      // from the collision domain...)
      var contactSet = ContactSet.Create(collisionObjectA, collisionObjectB);

      // Create a C# sample which visualizes the contact set.
      const string Filename = "DumpedContactSet001.cs";
      DumpContactSet(contactSet, Filename);

      GraphicsScreen.DebugRenderer2D.DrawText(
        "Contact set dumped into the file: " + Filename, 
        new Vector2F(300, 300), 
        Color.Black);
    }
开发者ID:,项目名称:,代码行数:29,代码来源:

示例2: ModelContainer

        public ModelContainer(Model modelpass, Pose posepass, SkeletonPose skeletonpass)
        {
            _model = modelpass;
            _pose = posepass;
            _skeleton = skeletonpass;

            var additionalData = (Dictionary<string,object>)_model.Tag;
            var animations = (Dictionary<string, SkeletonKeyFrameAnimation>)additionalData["Animations"];
            int index = 0;

            _animations = new ITimeline[animations.Count];

                _animations[0] = new AnimationClip<SkeletonPose>(animations["First"])
                {
                    LoopBehavior = LoopBehavior.Cycle,
                    Duration = TimeSpan.MaxValue
                };
                index++;

                _animations[1] = new AnimationClip<SkeletonPose>(animations["Second"]);

                _animations[2] = new AnimationClip<SkeletonPose>(animations["Second"])
                {
                    LoopBehavior = LoopBehavior.Cycle,
                    Duration = TimeSpan.MaxValue
                };
        }
开发者ID:HATtrick-games,项目名称:ICT309,代码行数:27,代码来源:ModelContainer.cs

示例3: Droid

 private Droid(Guid id, Pose pose, Guid inventoryID, Logic logic)
     : base(id)
 {
     _pose = pose;
     _inventoryID = inventoryID;
     _logic = logic;
 }
开发者ID:vvnurmi,项目名称:MOOLGOSS,代码行数:7,代码来源:Droid.cs

示例4: GetClosestPointCandidates

        public void GetClosestPointCandidates(Vector3F scale, Pose pose, ISpatialPartition<int> otherPartition, Vector3F otherScale, Pose otherPose, Func<int, int, float> callback)
        {
            if (otherPartition == null)
            throw new ArgumentNullException("otherPartition");

              if (callback == null)
            throw new ArgumentNullException("callback");

              // Make sure we are up-to-date.
              var otherBasePartition = otherPartition as BasePartition<int>;
              if (otherBasePartition != null)
            otherBasePartition.UpdateInternal();
              else
            otherPartition.Update(false);

              Update(false);

              if (_numberOfItems == 0)
            return;

              if (otherPartition is ISupportClosestPointQueries<int>)
              {
            // ----- CompressedAabbTree vs. ISupportClosestPointQueries<int>
            GetClosestPointCandidatesImpl(scale, pose, (ISupportClosestPointQueries<int>)otherPartition, otherScale, otherPose, callback);
              }
              else
              {
            // ----- CompressedAabbTree vs. *
            GetClosestPointCandidatesImpl(otherPartition, callback);
              }
        }
开发者ID:Zolniu,项目名称:DigitalRune,代码行数:31,代码来源:CompressedAabbTree_TreeVsTree.cs

示例5: PoseEventArgs

        /// <summary>
        /// Initializes a new instance of the <see cref="PoseEventArgs"/> class.
        /// </summary>
        /// <param name="myo">The Myo that raised the event. Cannot be <c>null</c>.</param>
        /// <param name="timestamp">The timestamp of the event.</param>
        /// <param name="pose">The pose that the Myo detected.</param>
        /// <exception cref="System.ArgumentNullException">
        /// The exception that is thrown when <paramref name="myo"/> is null.
        /// </exception>
        public PoseEventArgs(IMyo myo, DateTime timestamp, Pose pose)
            : base(myo, timestamp)
        {
            Contract.Requires<ArgumentNullException>(myo != null, "myo");

            this.Pose = pose;
        }
开发者ID:rafme,项目名称:MyoSharp,代码行数:16,代码来源:PoseEventArgs.cs

示例6: Clone

        public void Clone()
        {
            Pose poseA = new Pose(new Vector3F(1, 2, 3));
              PointShape pointA = new PointShape(3, 4, 5);
              GeometricObject geometryA = new GeometricObject(pointA, poseA);

              Pose poseB = new Pose(new Vector3F(1, 2, 3));
              PointShape pointB = new PointShape(3, 4, 5);
              GeometricObject geometryB = new GeometricObject(pointB, poseB);

              MinkowskiSumShape minkowskiSumShape = new MinkowskiSumShape(geometryA, geometryB);
              MinkowskiSumShape clone = minkowskiSumShape.Clone() as MinkowskiSumShape;
              Assert.IsNotNull(clone);
              Assert.IsNotNull(clone.ObjectA);
              Assert.IsNotNull(clone.ObjectB);
              Assert.AreNotSame(geometryA, clone.ObjectA);
              Assert.AreNotSame(geometryB, clone.ObjectB);
              Assert.IsTrue(clone.ObjectA is GeometricObject);
              Assert.IsTrue(clone.ObjectB is GeometricObject);
              Assert.AreEqual(poseA, clone.ObjectA.Pose);
              Assert.AreEqual(poseB, clone.ObjectB.Pose);
              Assert.IsNotNull(clone.ObjectA.Shape);
              Assert.IsNotNull(clone.ObjectB.Shape);
              Assert.AreNotSame(pointA, clone.ObjectA.Shape);
              Assert.AreNotSame(pointB, clone.ObjectB.Shape);
              Assert.IsTrue(clone.ObjectA.Shape is PointShape);
              Assert.IsTrue(clone.ObjectB.Shape is PointShape);
              Assert.AreEqual(pointA.Position, ((PointShape)clone.ObjectA.Shape).Position);
              Assert.AreEqual(pointB.Position, ((PointShape)clone.ObjectB.Shape).Position);
              Assert.AreEqual(minkowskiSumShape.GetAabb(Pose.Identity).Minimum, clone.GetAabb(Pose.Identity).Minimum);
              Assert.AreEqual(minkowskiSumShape.GetAabb(Pose.Identity).Maximum, clone.GetAabb(Pose.Identity).Maximum);
        }
开发者ID:,项目名称:,代码行数:32,代码来源:

示例7: BrownOut

    public BrownOut(ContentManager contentManager)
    {
      Pose = new Pose(Matrix33F.CreateRotationX(-ConstantsF.PiOver2));

      // Smoke on a ring.
      var outerRingSmoke = CreateSmoke(contentManager);
      outerRingSmoke.Effectors.Add(new StreamEmitter { DefaultEmissionRate = 30 });
      outerRingSmoke.Effectors.Add(new StartPositionEffector
      {
        Distribution = new CircleDistribution { OuterRadius = 5, InnerRadius = 4 }
      });

      // Smoke in the area inside the ring.
      var innerCircleSmoke = CreateSmoke(contentManager);
      innerCircleSmoke.Effectors.Add(new StreamEmitter { DefaultEmissionRate = 10 });
      innerCircleSmoke.Effectors.Add(new StartPositionEffector
      {
        Distribution = new CircleDistribution { OuterRadius = 4, InnerRadius = 0 }
      });

      // Uniform particle parameter that are the same for all child particle systems.
      Parameters.AddUniform<float>(ParticleParameterNames.Lifetime).DefaultValue = 5;
      _isDepthSortedParameter = Parameters.AddUniform<bool>(ParticleParameterNames.IsDepthSorted);
      _isDepthSortedParameter.DefaultValue = true;

      Children = new ParticleSystemCollection { outerRingSmoke, innerCircleSmoke };
    }
开发者ID:,项目名称:,代码行数:27,代码来源:

示例8: ReplacePose

 public Entity ReplacePose(Pose newCurrent) {
     var componentPool = GetComponentPool(UnitsComponentIds.Pose);
     var component = (PoseComponent)(componentPool.Count > 0 ? componentPool.Pop() : new PoseComponent());
     component.Current = newCurrent;
     ReplaceComponent(UnitsComponentIds.Pose, component);
     return this;
 }
开发者ID:GreatVV,项目名称:tactics,代码行数:7,代码来源:PoseComponentGeneratedExtension.cs

示例9: SetsPoseShortcut

 public void SetsPoseShortcut()
 {
     Actor a = new Actor();
     Pose p = new Pose();
     a.Add(p);
     Assert.AreSame(p, a.Pose);
 }
开发者ID:BackupTheBerlios,项目名称:flatfour-svn,代码行数:7,代码来源:Test_Actor.cs

示例10: HeldPose

        protected HeldPose(IMyoEventGenerator myo, TimeSpan interval, IEnumerable<Pose> targetPoses)
        {
            Contract.Requires<ArgumentNullException>(myo != null, "myo");
            Contract.Requires<ArgumentOutOfRangeException>(interval.TotalMilliseconds >= 0, "interval");
            Contract.Requires<ArgumentNullException>(targetPoses != null, "targetPoses");

            _targetPoses = new List<Pose>(targetPoses);
            if (_targetPoses.Contains(Pose.Unknown))
            {
                throw new ArgumentException("All target poses must be specified.", "targetPoses");
            }

            if (_targetPoses.Count < 1)
            {
                throw new ArgumentException("At least one target pose must be specified.", "targetPoses");
            }

            _timer = new Timer()
            {
                AutoReset = true,
                Interval = interval.TotalMilliseconds,
            };
            _timer.Elapsed += Timer_Elapsed;

            _lastPose = Pose.Unknown;

            _myo = myo;
            _myo.PoseChanged += Myo_PoseChanged;
        }
开发者ID:rafme,项目名称:MyoSharp,代码行数:29,代码来源:HeldPose.cs

示例11: SkinnedModelBoneContent

 internal SkinnedModelBoneContent(ushort index, string name, Pose bindPose,
     Matrix inverseBindPoseTransform)
 {
     this.index = index;
     this.name = name;
     this.bindPose = bindPose;
     this.inverseBindPoseTransform = inverseBindPoseTransform;
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:8,代码来源:SkinnedModelBoneContent.cs

示例12: LinearSequence

 public LinearSequence(AnimationData anim, bool loop)
 {
     Loop = loop;
     this.anim = anim;
     Speed = 1.0f;
     pose = new Pose(anim.Frames[0]);
     length = anim.Frames.Count/anim.Speed;
 }
开发者ID:jyunfan2015,项目名称:Calcifer,代码行数:8,代码来源:LinearSequence.cs

示例13: Lerp

 public static Pose Lerp( Pose p1, Pose p2, float t )
 {
     return new Pose(
                     Vector3.Lerp( p1.position, p2.position, t ),
                     Quaternion.Lerp( p1.rotation, p2.rotation, t ),
                     Vector3.Lerp( p1.scale, p2.scale, t )
                     );
 }
开发者ID:johnsietsma,项目名称:eons,代码行数:8,代码来源:Pose.cs

示例14: Start

	// Use this for initialization
	void Start () {
		//the init status of the enmeny
		mDir = _CurDir;
		mPose = CurPose;

		if (Parent != null) {
			Parent.Start();
		}
	}
开发者ID:ziyihu,项目名称:TowerDefence,代码行数:10,代码来源:CharacterStatus.cs

示例15: CheckDir

	//change the direction of the character
	public void CheckDir(){
		if (gameObject == null) {
			return;
		} 
		needChangeStatus = false;
		if (mDir != _CurDir) {
			needChangeStatus = true;
			mDir = _CurDir;
		}
		if (mPose != CurPose) {
			needChangeStatus = true;
			mPose = CurPose;
		}
		Quaternion dir = gameObject.transform.localRotation;
		float curAngle = dir.eulerAngles.y % 360.0f;
		curAngle = curAngle < 0.0f ? curAngle + 360.0f : curAngle;
		//rotate the weapon
		if (rotateWeapon && CurPose != Pose.Die) {
			QuadTextureNgui tex = transform.GetChild(0).GetComponent<QuadTextureNgui>();
			if(curAngle >= 0.0f && curAngle <= 151f){
				int angle = ((int)(curAngle/10.0f) * 10);
				tex.mSpriteName = ""+angle;
				tex.mirrorX = false;
				tex.InitFace();
			} else if (curAngle > 151.0f && curAngle <= 301.0f){
				int angle = ((int)((301.0f - curAngle)/10.0f) * 10);
				tex.mSpriteName = ""+angle;
				tex.mirrorX = true;
				tex.InitFace();
			} else if(curAngle > 301.0f && curAngle <= 321.0f){
				int angle = ((int)((661.0f - curAngle)/10.0f) * 10);
				tex.mSpriteName = ""+angle;
				tex.mirrorX = true;
				tex.InitFace();
			}
		} else {
			//will not be used
			if((curAngle >= 0.0f && curAngle < 45.0f) || (curAngle > 315.0f && curAngle <= 360.0f)){
				_CurDir = Dir.RightUp;
			} 
			else if(curAngle >= 270.0f && curAngle <= 315.0f){
				_CurDir = Dir.LeftUp;
			}
			else if(curAngle >= 45.0f && curAngle < 90.0f){
				_CurDir = Dir.Right;
			}
			else if(curAngle >= 100.0f && curAngle < 270.0f){
				_CurDir = Dir.Left;
			}
			else if(curAngle >= 127.0f && curAngle < 180.0f){
				_CurDir = Dir.LeftDown;
			} 
			else if(curAngle >= 90.0f && curAngle < 127.0f){
				_CurDir = Dir.RightDown;
			}
		}
	}
开发者ID:ziyihu,项目名称:TowerDefence,代码行数:58,代码来源:CharacterStatus.cs


注:本文中的Pose类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。