using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using MikuMikuDance.XNA.Stages;
using Microsoft.Xna.Framework.Graphics;
using BulletX.LinerMath;
using BulletX.BulletDynamics.Dynamics;
using BulletX.BulletCollision.CollisionShapes;

namespace BulletTest
{
    class CapsuleObj : PhysicsObj
    {
        public CapsuleObj(Game game, IMMDCamera camera, Model model, Vector3 sideLengths,
            btTransform startTransform, DiscreteDynamicsWorld world)
            : base(game, camera, model)
        {
            //1. 衝突スキン作成
            collision = new CapsuleShapeZ(sideLengths.X, sideLengths.Y);
            // 2.	初期の位置と姿勢。
            DefaultMotionState motionState = new DefaultMotionState(startTransform, btTransform.Identity);
            //3.イナーシャの作成
            btVector3 localInertia;
            collision.calculateLocalInertia(1.0f, out localInertia);
            //4.剛体の作成
            body = new RigidBody(1.0f, motionState, collision, localInertia);
            //5.ボディを有効化する
            world.addRigidBody(body, -1, -1);



            
            color = Vector3.One;
        }
    }
}
