/// カプセルとカプセルとの衝突
        public bool Check(DemoGame.GeometryCapsule moveCap, ShapeCapsule trgCap)
        {
            /// 同じ座標にいる場合はすり抜ける
            if (moveCap.StartPos == trgCap.Capsule.StartPos)
            {
                //           return false;
            }

            /// 対象と反対向きへ移動する際にはすり抜ける
            float rot = Common.VectorUtil.GetPointRotY(moveCap.Line.Vec, moveCap.StartPos, trgCap.Capsule.StartPos);

            if (rot <= -50.0f || rot >= 50.0f)
            {
//            return false;
            }

            Vector3 collPos = StaticDataList.getVectorZero();

            calMovePos = moveCap.EndPos;
            if (DemoGame.CommonCollision.CheckCapsuleAndCapsule(moveCap, trgCap.Capsule, ref collPos) == true)
            {
                calMovePos = collPos;
                return(true);
            }

            return(false);
        }
Exemple #2
0
        /// 初期化
        public override bool DoInit()
        {
            shapeMove = null;

            shapeMove = new ShapeSphere();
            shapeMove.Init(1);
            shapeMove.Set(0, StaticDataList.getVectorZero(), 0.4f);

            shapeColl = new ShapeCapsule();
            shapeColl.Init(1);
            shapeColl.Set(0, StaticDataList.getVectorZero(), new Vector3(0.0f, 2.0f, 0.0f), (float)Data.SetupValue.TitanSize);

            shapeCollforDis = new ShapeCapsule();
            shapeCollforDis.Init(1);
            shapeCollforDis.Set(0, StaticDataList.getVectorZero(), new Vector3(0.0f, 2.0f, 0.0f), (float)Data.SetupValue.TouchSize);

            appearCount = 30;
            glowCounter = 0;
            scale       = (int)Data.SetupValue.WallScale / 100.0f;

            farFlag = false;

            distance = Common.VectorUtil.DistanceXZ(pos1, pos2);
            angle    = FMath.Atan((pos1.X - pos2.X) / (pos1.Z - pos2.Z)) + FMath.PI / 2;

            return(true);
        }
Exemple #3
0
        /// 破棄
        public override void DoTerm()
        {
            if (shapeMove != null)
            {
                shapeMove.Term();
            }
            if (shapeColl != null)
            {
                shapeColl.Term();
            }
            if (shapeCollforDis != null)
            {
                shapeCollforDis.Term();
            }

/*        if( useMdlHdl != null ){
 *          useMdlHdl.Term();
 *      }
 */
            shapeMove       = null;
            shapeColl       = null;
            shapeCollforDis = null;

//        useMdlHdl = null;
            vertices.Dispose();
            spriteShader.Dispose();
        }
Exemple #4
0
        /// 初期化
        public override bool DoInit()
        {
            shapeMove = null;

            shapeMove = new ShapeSphere();
            shapeMove.Init(1);
            shapeMove.Set(0, StaticDataList.getVectorZero(), 0.3f);

            shapeColl = new ShapeCapsule();
            shapeColl.Init(1);
            shapeColl.Set(0, StaticDataList.getVectorZero(), new Vector3(0.0f, 2.0f, 0.0f), (float)Data.SetupValue.TitanSize);

            shapeCollforDis = new ShapeCapsule();
            shapeCollforDis.Init(1);
            shapeCollforDis.Set(0, StaticDataList.getVectorZero(), new Vector3(0.0f, 2.0f, 0.0f), (float)Data.SetupValue.TouchSize);
            scale = (int)Data.SetupValue.CharScale / 100.0f;

            moveAngle   = false;
            preDeadFlag = false;



//			useMdlHdl = new Common.ModelHandle();
//        useMdlHdl.Init();
            return(true);
        }
        /// ラインとカプセルとの衝突
        public bool CheckCapsule( DemoGame.GeometryLine moveLine, ShapeCapsule trgCapsule )
        {
            Vector3 collPos = new Vector3(0,0,0);

            calMovePos = moveLine.EndPos;
            if( DemoGame.CommonCollision.CheckLineAndCapsule( moveLine, trgCapsule.Capsule, ref collPos ) == true ){
            calMovePos       = collPos;
            calBestDis       = Common.VectorUtil.Distance( collPos, moveLine.StartPos );
            calBestId        = 0;
            return true;
            }
            return false;
        }
        /// ラインとカプセルとの衝突
        public bool CheckCapsule(DemoGame.GeometryLine moveLine, ShapeCapsule trgCapsule)
        {
            Vector3 collPos = new Vector3(0, 0, 0);

            calMovePos = moveLine.EndPos;
            if (DemoGame.CommonCollision.CheckLineAndCapsule(moveLine, trgCapsule.Capsule, ref collPos) == true)
            {
                calMovePos = collPos;
                calBestDis = Common.VectorUtil.Distance(collPos, moveLine.StartPos);
                calBestId  = 0;
                return(true);
            }
            return(false);
        }
/// 継承メソッド
///---------------------------------------------------------------------------

        /// 初期化
        public override bool DoInit()
        {
            shapeMove = null;

            shapeMove = new ShapeSphere();
            shapeMove.Init(1);
            shapeMove.Set(0, StaticDataList.getVectorZero(), 0.4f);

            shapeColl = new ShapeCapsule();
            shapeColl.Init(1);
            shapeColl.Set(0, StaticDataList.getVectorZero(), new Vector3(0.0f, 2.0f, 0.0f), (float)Data.SetupValue.TitanSize);

            shapeCollforDis = new ShapeCapsule();
            shapeCollforDis.Init(1);
            shapeCollforDis.Set(0, StaticDataList.getVectorZero(), new Vector3(0.0f, 2.0f, 0.0f), (float)Data.SetupValue.TouchSize);

            return(true);
        }
Exemple #8
0
        /// 破棄
        public override void DoTerm()
        {
            if (shapeMove != null)
            {
                shapeMove.Term();
            }
            if (shapeColl != null)
            {
                shapeColl.Term();
            }
            if (shapeCollforDis != null)
            {
                shapeCollforDis.Term();
            }

            shapeMove       = null;
            shapeColl       = null;
            shapeCollforDis = null;
        }
Exemple #9
0
        /// 初期化
        public override bool DoInit()
        {
            shapeMove = null;

            shapeMove = new ShapeSphere();
            shapeMove.Init(1);
            shapeMove.Set(0, StaticDataList.getVectorZero(), 0.4f);

            shapeColl = new ShapeCapsule();
            shapeColl.Init(1);
            shapeColl.Set(0, StaticDataList.getVectorZero(), new Vector3(0.0f, 2.0f, 0.0f), (float)Data.SetupValue.TitanSize);

            shapeCollforDis = new ShapeCapsule();
            shapeCollforDis.Init(1);
            shapeCollforDis.Set(0, StaticDataList.getVectorZero(), new Vector3(0.0f, 2.0f, 0.0f), (float)Data.SetupValue.TouchSize);
            farFlag       = false;
            countForHouse = (int)Data.SetupValue.NewHouseAppearTime;
            return(true);
        }
        /// 継承メソッド
        ///---------------------------------------------------------------------------
        /// 初期化
        public override bool DoInit()
        {
            shapeMove = null;

            shapeMove = new ShapeSphere();
            shapeMove.Init(1);
            shapeMove.Set( 0, StaticDataList.getVectorZero(), 0.4f );

            shapeColl = new ShapeCapsule();
            shapeColl.Init(1);
            shapeColl.Set( 0, StaticDataList.getVectorZero(), new Vector3(0.0f, 2.0f, 0.0f), (float)Data.SetupValue.TitanSize );

            shapeCollforDis = new ShapeCapsule();
            shapeCollforDis.Init(1);
            shapeCollforDis.Set( 0, StaticDataList.getVectorZero(), new Vector3(0.0f, 2.0f, 0.0f), (float)Data.SetupValue.TouchSize );

            farFlag = false;
            return true;
        }
Exemple #11
0
        /// 初期化
        public override bool DoInit()
        {
            shapeMove = null;

            shapeMove = new ShapeSphere();
            shapeMove.Init(1);
            shapeMove.Set(0, StaticDataList.getVectorZero(), 0.4f);

            shapeColl = new ShapeCapsule();
            shapeColl.Init(1);
            shapeColl.Set(0, StaticDataList.getVectorZero(), new Vector3(0.0f, 2.0f, 0.0f), (float)Data.SetupValue.TitanSize);

            shapeCollforDis = new ShapeCapsule();
            shapeCollforDis.Init(1);
            shapeCollforDis.Set(0, StaticDataList.getVectorZero(), new Vector3(0.0f, 2.0f, 0.0f), (float)Data.SetupValue.TouchSize);

            glowCounter = 0;
            scale       = (int)Data.SetupValue.TowerScale / 100.0f;
            farFlag     = false;
            return(true);
        }
Exemple #12
0
        /// 破棄
        public override void DoTerm()
        {
            if (shapeMove != null)
            {
                shapeMove.Term();
            }
            if (shapeColl != null)
            {
                shapeColl.Term();
            }
            if (shapeCollforDis != null)
            {
                shapeCollforDis.Term();
            }

            shapeMove       = null;
            shapeColl       = null;
            shapeCollforDis = null;
            vertices.Dispose();
            spriteShader.Dispose();
        }
        /// 破棄
        public override void DoTerm()
        {
            if (shapeMove != null)
            {
                shapeMove.Term();
            }
            if (shapeColl != null)
            {
                shapeColl.Term();
            }
            if (shapeCollforDis != null)
            {
                shapeCollforDis.Term();
            }

/*        if( useMdlHdl != null ){
 *          useMdlHdl.Term();
 *      }
 */
            shapeMove       = null;
            shapeColl       = null;
            shapeCollforDis = null;
        }
Exemple #14
0
        /// 破棄
        public override void DoTerm()
        {
            if( shapeMove != null ){
            shapeMove.Term();
            }
            if( shapeColl != null ){
            shapeColl.Term();
            }
            if( shapeCollforDis != null ){
            shapeCollforDis.Term();
            }

            /*        if( useMdlHdl != null ){
            useMdlHdl.Term();
            }
            */
            shapeMove = null;
            shapeColl = null;
            shapeCollforDis = null;
            vertices.Dispose();
            spriteShader.Dispose();
        }
        /// 破棄
        public override void DoTerm()
        {
            if( shapeMove != null ){
            shapeMove.Term();
            }
            if( shapeColl != null ){
            shapeColl.Term();
            }
            if( shapeCollforDis != null ){
            shapeCollforDis.Term();
            }

            /*        if( useMdlHdl != null ){
            useMdlHdl.Term();
            }
            */
            shapeMove = null;
            shapeColl = null;
            shapeCollforDis = null;
        }
Exemple #16
0
        /// 初期化
        public override bool DoInit()
        {
            shapeMove = null;

            shapeMove = new ShapeSphere();
            shapeMove.Init(1);
            shapeMove.Set( 0, StaticDataList.getVectorZero(), 0.3f );

            shapeColl = new ShapeCapsule();
            shapeColl.Init(1);
            shapeColl.Set( 0, StaticDataList.getVectorZero(), new Vector3(0.0f, 2.0f, 0.0f), (float)Data.SetupValue.TitanSize );

            shapeCollforDis = new ShapeCapsule();
            shapeCollforDis.Init(1);
            shapeCollforDis.Set( 0, StaticDataList.getVectorZero(), new Vector3(0.0f, 2.0f, 0.0f), (float)Data.SetupValue.TouchSize );
            scale = (int)Data.SetupValue.CharScale/100.0f;

            moveAngle = false;

            //			useMdlHdl = new Common.ModelHandle();
            //        useMdlHdl.Init();
            return true;
        }
Exemple #17
0
        /// 初期化
        public override bool DoInit()
        {
            shapeMove = null;

            shapeMove = new ShapeSphere();
            shapeMove.Init(1);
            shapeMove.Set( 0, StaticDataList.getVectorZero(), 0.4f );

            shapeColl = new ShapeCapsule();
            shapeColl.Init(1);
            shapeColl.Set( 0, StaticDataList.getVectorZero(), new Vector3(0.0f, 2.0f, 0.0f), (float)Data.SetupValue.TitanSize );

            shapeCollforDis = new ShapeCapsule();
            shapeCollforDis.Init(1);
            shapeCollforDis.Set( 0, StaticDataList.getVectorZero(), new Vector3(0.0f, 2.0f, 0.0f), (float)Data.SetupValue.TouchSize );

            glowCounter = 0;
            scale = (int)Data.SetupValue.TowerScale /100.0f;
            return true;
        }
        /// 破棄
        public override void DoTerm()
        {
            if( shapeMove != null ){
            shapeMove.Term();
            }
            if( shapeColl != null ){
            shapeColl.Term();
            }
            if( shapeCollforDis != null ){
            shapeCollforDis.Term();
            }

            shapeMove = null;
            shapeColl = null;
            shapeCollforDis = null;
        }
        /// 初期化
        public override bool DoInit()
        {
            shapeMove = null;

            shapeMove = new ShapeSphere();
            shapeMove.Init(1);
            shapeMove.Set( 0, StaticDataList.getVectorZero(), 0.4f );

            shapeColl = new ShapeCapsule();
            shapeColl.Init(1);
            shapeColl.Set( 0, StaticDataList.getVectorZero(), new Vector3(0.0f, 2.0f, 0.0f), (float)Data.SetupValue.TitanSize );

            shapeCollforDis = new ShapeCapsule();
            shapeCollforDis.Init(1);
            shapeCollforDis.Set( 0, StaticDataList.getVectorZero(), new Vector3(0.0f, 2.0f, 0.0f), (float)Data.SetupValue.TouchSize );

            scale = (int)Data.SetupValue.WallScale /100.0f;

            farFlag = false;

            distance = Common.VectorUtil.DistanceXZ( pos1 ,pos2 );
            angle = FMath.Atan((pos1.X-pos2.X)/(pos1.Z-pos2.Z)) +FMath.PI/2;

            return true;
        }
        /// カプセルとカプセルとの衝突
        public bool Check( DemoGame.GeometryCapsule moveCap, ShapeCapsule trgCap )
        {
            /// 同じ座標にいる場合はすり抜ける
            if( moveCap.StartPos == trgCap.Capsule.StartPos ){
             //           return false;
            }

            /// 対象と反対向きへ移動する際にはすり抜ける
            float rot = Common.VectorUtil.GetPointRotY( moveCap.Line.Vec, moveCap.StartPos, trgCap.Capsule.StartPos );
            if( rot <= -50.0f || rot >= 50.0f ){
            //            return false;
            }

            Vector3 collPos = StaticDataList.getVectorZero();

            calMovePos = moveCap.EndPos;
            if( DemoGame.CommonCollision.CheckCapsuleAndCapsule( moveCap, trgCap.Capsule, ref collPos ) == true ){
            calMovePos        = collPos;
            return true;
            }

            return false;
        }