public ClipPlayer(SkinningData skd, float fps) { skinData = skd; boneTransforms = new Matrix[skd.BindPose.Count]; skinTransforms = new Matrix[skd.BindPose.Count]; worldTransforms = new Matrix[skd.BindPose.Count]; this.fps = fps; }
/// <summary> /// Constructs a new animation player. /// </summary> public AnimationPlayer(SkinningData skinningData) { if (skinningData == null) throw new ArgumentNullException("skinningData"); skinningDataValue = skinningData; boneTransforms = new Matrix[skinningData.BindPose.Count]; worldTransforms = new Matrix[skinningData.BindPose.Count]; skinTransforms = new Matrix[skinningData.BindPose.Count]; }
public Enemy(Vector3 pos, Model model, Matrix projection) { position = pos + new Vector3(0, 0, 0); intersectionTestSphere = new BoundingSphere(Vector3.Zero, 10); playerBoundingPosition = new BoundingSphere(Vector3.Zero, minimum_distance_to_player); chaseSphere = new BoundingSphere(position, distance_to_search_for_player); boundingSphere = new BoundingSphere(position, 150); this.model = model; viewMatrix = Matrix.Identity; worldMatrix = Matrix.Identity; skd = model.Tag as SkinningData; clipPlayer = new ClipPlayer(skd, 60);//ClipPlayer running at 24 frames/sec AnimationClip clip = skd.AnimationClips["Take 002"]; //Take name from the dude.fbx file clipPlayer.play(clip, 99, 124, true); this.projection = projection; enemyMatrix = Matrix.CreateScale(1) * Matrix.CreateRotationY((float)MathHelper.Pi * 2) * //Matrix.CreateFromQuaternion(dudeQRot) * Matrix.CreateTranslation(position); }