public CharactorPreview(Rectangle drawRect, Texture2D background, Texture2D ngTexture, PlayerIndex playerID) : base(drawRect) { this.drawRect = drawRect; this.playerID = playerID; this.camera = new Camera(); camera.FieldOfViewRadian = MathHelper.PiOver4; camera.Target = new Vector3(0, 0, -10); camera.Position = new Vector3(0.0f, 3, 6); this.background = background; this.ngTexture = ngTexture; info = new ModelInfo(); isConflict = false; }
/// <param name="owner">生成したプレイヤー</param> public Attack(Player owner) { this.owner = owner; model = owner.AttackModel; Speed = owner.AttackSpeed; ModelInfo = new ModelInfo(); ModelInfo.Position = owner.AttackPosition; Vector3 direction = owner.Direction; ModelInfo.Radian.Y = owner.RadianY; Vector3 blockPosition = ModelInfo.Position; blockPosition.Y--; this.BlockPosition = blockPosition; }
/// <summary> /// 描画 /// </summary> public void Draw(Camera camera, ModelInfo modelInfo) { // ボーンの取得 Matrix[] bones = animationPlayer.GetSkinTransforms(); // ワールド座標 Matrix world = modelInfo.World; foreach (ModelMesh mesh in currentModel.Meshes) { foreach (SkinnedEffect effect in mesh.Effects) { effect.EnableDefaultLighting(); effect.SetBoneTransforms(bones); effect.World = world; effect.View = camera.View; effect.Projection = camera.Projection; } mesh.Draw(); } }
public Fallable() { ModelInfo = new ModelInfo(); ResetStatusOfFalling(); }