/// シーンの初期化 public bool Init(DemoGame.SceneManager sceneMgr) { useSceneMgr = sceneMgr; calCollGrav = new ActorUnitCollGravity(); calCollGrav.Init(); moveCollMgr = new GameActorCollManager(); moveCollMgr.Init(); shapeMove = new ShapeSphere(); shapeMove.Init(1); shapeMove.Set(0, StaticDataList.getVectorZero(), 0.001f); renderSph = new DemoGame.RenderGeometry(); renderSph.MakeSphere(); /// trgObj = null; /// 移動する自身のOBJを登録 moveCollMgr.SetMoveShape(shapeMove); trgObjMoveSpd = 1.0f; setPlaceTypeParam(trgObjType); nowTaskId = debugMenuTaskId.SelectObj; changeTask(debugMenuTaskId.SelectObj); return(true); }
/// 破棄 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(); }
/// アクタの所属マップ生成 private void updateGridEntryList() { Vector3 pos = StaticDataList.getVectorZero(); for (int i = 0; i < gridMax; i++) { gridActorIdxList[i].Clear(); } for (int x = 0; x < gridNum; x++) { pos.X = -300.0f + 2.5f + x * 5.0f; for (int y = 0; y < gridNum; y++) { pos.Z = -300.0f + 2.5f + y * 5.0f; for (int i = 0; i < actorFixList.Count; i++) { ShapeSphere bndSph = actorFixList[i].GetBoundingShape(); if (Common.VectorUtil.DistanceXZ(pos, GetPos(i)) < gridAreaDis + bndSph.Sphre.R) { gridActorIdxList[x + y * gridNum].Add(i); } } } } }
/// シーンの破棄 public void Term() { if (calCollGrav != null) { calCollGrav.Term(); } if (moveCollMgr != null) { moveCollMgr.Term(); } if (shapeMove != null) { shapeMove.Term(); } if (renderSph != null) { renderSph.Dispose(); } /// trgObj = null; renderSph = null; shapeMove = null; moveCollMgr = null; calCollGrav = null; useSceneMgr = null; }
/// 移動先のセット public void GetMovePos(GameActorCollManager collMgr, ref Vector3 movePos) { ShapeSphere moveSph = (ShapeSphere)collMgr.MoveShape; movePos = moveSph.Sphre.Pos; movePos.Y -= 0.5f; }
/// 初期化 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 void changeAnimation(bool Flag){ * actorCh.changeAnimation(Flag); * } */ /// フレーム:目的地への移動FPS視点 private bool frameDestinationMoveFps() { GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance(); float rotY; float cal; float angleY; float mPow = moveSpeed; /// 目的地が設定されている場合 ///---------------------------------------------------- if (ctrlResMgr.CtrlStg.CheckDestinationTrg()) { float trgDis = Common.VectorUtil.DistanceXZ(actorCh.BasePos, ctrlResMgr.CtrlStg.GetDestinationPos()); GameActorProduct trgActor = ctrlResMgr.CtrlStg.GetDestinationActor(); ShapeSphere bndSph = trgActor.GetBoundingShape(); if (mPow > trgDis) { mPow = trgDis; } /// 目的地到着 if (trgDis <= mPow || (bndSph != null && trgDis <= bndSph.Sphre.R * 1.5f)) { ctrlResMgr.CtrlStg.ClearDestination(); actorCh.SetStateMove(new Vector3(actorCh.BaseMtx.M31, actorCh.BaseMtx.M32, actorCh.BaseMtx.M33), mPow, 0, false); if (bndSph != null) { actorCh.Frame(); setPlayMode(PlayModeId.Normal); actorCh.SetStateAttack(0); } return(false); } actorCh.SetLookTrgPos(ctrlResMgr.CtrlStg.GetDestinationPos()); } /// 直進移動 ///---------------------------------------------------- else { rotY = 180.0f + ctrlResMgr.CtrlCam.GetCamRotY() + AppInput.GetInstance().GetPlRotY(); cal = (float)(3.141593f / 180.0); angleY = rotY * cal; actorCh.BaseMtx = Matrix4.RotationY(angleY); Common.MatrixUtil.SetTranslate(ref actorCh.BaseMtx, actorCh.BasePos); actorCh.SetPlace(actorCh.BaseMtx); } actorCh.SetStateMove(new Vector3(actorCh.BaseMtx.M31, actorCh.BaseMtx.M32, actorCh.BaseMtx.M33), mPow, 0, false); return(true); }
/// 破棄 public override void DoTerm() { if (shapeMove != null) { shapeMove.Term(); } shapeMove = null; // titanModel.Dispose(); program.Dispose(); }
/// キャラクタの登録 public void EntryCharacter(GameActorProduct actor, bool cullingFlg) { ShapeSphere bndSph = actor.GetBoundingShape(); if (cullingFlg == false || cullingShape.CheckNearDis(bndSph.Sphre.Pos) < bndSph.Sphre.R) { float dis = Common.VectorUtil.Distance(actor.BasePos, GameCtrlManager.GetInstance().CtrlCam.GetCamPos()); entryActor(actor, dis); } }
/// 継承メソッド ///--------------------------------------------------------------------------- /// 初期化 public override bool DoInit() { shapeMove = null; shapeMove = new ShapeSphere(); shapeMove.Init(1); shapeMove.Set(0, StaticDataList.getVectorZero(), objWidth); // titanModel = new BasicModel("/Application/res/data/3D/char/titan.mdx", 0); program = new BasicProgram(); return(true); }
/// 継承メソッド ///--------------------------------------------------------------------------- /// 初期化 public override bool DoInit() { shapeMove = null; shapeMove = new ShapeSphere(); shapeMove.Init(1); shapeMove.Set(0, new Vector3(0.0f, 0.0f, 0.0f), objWidth); useMdlHdl = new Common.ModelHandle(); useMdlHdl.Init(); baseScale = new Vector3(1.0f, 1.0f, 1.0f); return(true); }
/// 継承メソッド ///--------------------------------------------------------------------------- /// 初期化 public override bool DoInit() { shapeMove = null; shapeMove = new ShapeSphere(); shapeMove.Init(1); shapeMove.Set( 0, new Vector3(0.0f, 0.0f, 0.0f), objWidth ); useMdlHdl = new Common.ModelHandle(); useMdlHdl.Init(); baseScale = new Vector3( 1.0f, 1.0f, 1.0f ); return true; }
/// 破棄 public override void DoTerm() { if (shapeMove != null) { shapeMove.Term(); } if (useMdlHdl != null) { useMdlHdl.Term(); } shapeMove = null; useMdlHdl = null; }
/// チェック public bool Check(GameActorCollManager collMgr, Vector3 movePos) { ShapeSphere moveSph = (ShapeSphere)collMgr.MoveShape; moveMoveCap.Set(moveSph.Sphre.Pos, movePos, moveSph.Sphre.R); collMgr.StartCollision(); for (int i = 0; i < collMgr.TrgContainer.Num; i++) { GameObjProduct trgObj = collMgr.TrgContainer.GetEntryObj(i); for (int x = 0; x < trgObj.GetCollisionShapeMax(moveType); x++) { GameShapeProduct trgShape = trgObj.GetCollisionShape(moveType, x); bool hitFlg = false; switch (trgShape.GetShapeType()) { /// 三角形 case GameShapeProduct.TypeId.Triangles: hitFlg = calCollSphMove.Check(moveMoveCap, (ShapeTriangles)trgShape); break; /// カプセル case GameShapeProduct.TypeId.Capsule: hitFlg = calCollSphMove.Check(moveMoveCap, (ShapeCapsule)trgShape); break; } /// 衝突 if (hitFlg) { collMgr.SetCollParam(i, x, calCollSphMove.BestId, calCollSphMove.BestDis); if (moveType == Data.CollTypeId.ChMove) { trgObj.deadFlag = true; } } } } /// 衝突後の移動座標をセット setScrapedMovePos(collMgr, movePos); /// 衝突した return(collMgr.CheckCollHit()); }
/// 衝突後の移動座標をセット(三角形との衝突) private void setScrapedMovePosTriangle(GameActorCollManager collMgr, Vector3 movePos, ShapeTriangles shapeTri) { ShapeSphere moveSph = (ShapeSphere)collMgr.MoveShape; int primId = collMgr.TrgContainer.GetEntryPrimId(0); Vector3 collPos = StaticDataList.getVectorZero(); float scrapedPow = (moveSph.Sphre.R + 0.001f); /// 点と面上の最近接点を求める DemoGame.CommonCollision.GetClosestPtPosPlane(movePos, shapeTri.Triangle[primId].Plane, ref collPos); /// 移動候補座標更新 nextPos.X = collPos.X + (scrapedPow * (shapeTri.Triangle[primId].Plane.Nor.X)); nextPos.Y = collPos.Y + (scrapedPow * (shapeTri.Triangle[primId].Plane.Nor.Y)); nextPos.Z = collPos.Z + (scrapedPow * (shapeTri.Triangle[primId].Plane.Nor.Z)); }
public void findingTower(int scrPosX, int scrPosY) { GameActorCollManager useCollMgr = actorDestination.GetMoveCollManager(); Vector3 posStart = new Vector3(0, 0, 0); Vector3 posEnd = new Vector3(0, 0, 0); /// チェックする開始座標と終了座標のセット ctrlResMgr.GraphDev.GetScreenToWorldPos(scrPosX, scrPosY, 0.0f, ref posStart); ctrlResMgr.GraphDev.GetScreenToWorldPos(scrPosX, scrPosY, 1.0f, ref posEnd); DemoGame.GeometryLine moveMoveLine = new DemoGame.GeometryLine(posStart, posEnd); /// 衝突対象の登録 useCollMgr.TrgContainer.Clear(); ctrlResMgr.CtrlTo.SetDestinationActor(useCollMgr.TrgContainer); /// 衝突判定 calCollLook.SetMoveType(Data.CollTypeId.ChDestination); bool checkBound = calCollLook.Check(useCollMgr, moveMoveLine); if (checkBound) { destinationTrgActor = useCollMgr.TrgContainer.GetEntryObjParent(0); ShapeSphere bndSph = destinationTrgActor.GetBoundingShape(); if (destinationTrgActor.CheckMoveTrgId() == 2) { mode = 2; if (bndSph != null) { TouchPostion = bndSph.Sphre.Pos; } else { TouchPostion = destinationTrgActor.BasePos; } } else { TouchPostion = calCollLook.NextPos; } } }
/// public メソッド ///-------------------------------------------------------------------------- - /// 初期化 public bool Init() { boundingShape = new ShapeSphere(); boundingShape.Init(1); boundingShape.Set(0, new Vector3(0.0f, 0.0f, 0.0f), 1.0f); deadFlag = false; changeFlag = false; glowNumber = 0; glowCounter = 0; appearCount = (int)Data.SetupValue.AppearAndLeaveTime; firstFlag = true; eatFlag = false; glowFinish = false; farFlag = false; rotation.Z = 0.0f; return(DoInit()); }
/// 継承メソッド ///--------------------------------------------------------------------------- /// 初期化 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); }
/// 破棄 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); 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; }
/// 初期化 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); }
/// 衝突後の移動座標をセット(三角形との衝突) public void setScrapedMovePosTriangle(GameActorCollManager collMgr, Vector3 movePos, ShapeTriangles shapeTri) { ShapeSphere moveSph = (ShapeSphere)collMgr.MoveShape; int primId = collMgr.TrgContainer.GetEntryPrimId(0); Vector3 collPos = StaticDataList.getVectorZero(); float scrapedPow = (moveSph.Sphre.R + 0.001f); /// 弾く力の算出 moveMoveCap.Set(moveSph.Sphre.Pos, movePos, moveSph.Sphre.R); DemoGame.CommonCollision.CheckSphereAndTriangle(moveMoveCap, shapeTri.Triangle[primId], ref collPos); /// 移動候補座標更新 nextPos.X = moveSph.Sphre.Pos.X; nextPos.Y = collPos.Y + (scrapedPow * (shapeTri.Triangle[primId].Plane.Nor.Y)); nextPos.Z = moveSph.Sphre.Pos.Z; touchGroundType = shapeTri.CollisionType; touchGroundFlg = true; treadVec = shapeTri.Triangle[primId].Plane.Nor; }
/// 破棄 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; }
/// 初期化 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 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; }
/// 壁の生成 public void makeWall(int scrPosX, int scrPosY) { GameActorCollManager useCollMgr = actorDestination.GetMoveCollManager(); Vector3 posStart = new Vector3(0, 0, 0); Vector3 posEnd = new Vector3(0, 0, 0); /// チェックする開始座標と終了座標のセット ctrlResMgr.GraphDev.GetScreenToWorldPos(scrPosX, scrPosY, 0.0f, ref posStart); ctrlResMgr.GraphDev.GetScreenToWorldPos(scrPosX, scrPosY, 1.0f, ref posEnd); DemoGame.GeometryLine moveMoveLine = new DemoGame.GeometryLine(posStart, posEnd); /// 衝突対象の登録 useCollMgr.TrgContainer.Clear(); ctrlResMgr.CtrlTo.SetDestinationActor(useCollMgr.TrgContainer); useCollMgr.TrgContainer.Add(actorStg, actorStg.GetUseObj(0)); /// 衝突判定 calCollLook.SetMoveType(Data.CollTypeId.ChDestination); bool checkBound = calCollLook.Check(useCollMgr, moveMoveLine); if (checkBound) { /// マーカーのセット // actorDestination.Start(); Matrix4 mtx = Matrix4.RotationY(0); destinationTrgActor = useCollMgr.TrgContainer.GetEntryObjParent(0); ShapeSphere bndSph = destinationTrgActor.GetBoundingShape(); if (destinationTrgActor.CheckMoveTrgId() == 2) //始点の建物に接触 { towerNowPos = destinationTrgActor.BasePos; TouchPostion = destinationTrgActor.BasePos; if (towerPos.X != towerNowPos.X && towerPos.Z != towerNowPos.Z && !(towerPos.X == 0.0f && towerPos.Y == 0.0f && towerPos.Z == 0.0f)) //最初のタッチ以外もしくは前のタワー以外との接触の場合 { if (bndSph != null) { towerNowPos.Y += bndSph.Sphre.R; } towerNowPos.Y += 0.1f; ctrlResMgr.AddWall = true; ctrlResMgr.AddWallPos1 = towerPos; ctrlResMgr.AddWallPos2 = towerNowPos; makeTowerFlag = false; Console.WriteLine("asdf"); } } else { Console.WriteLine("fdsa"); towerNowPos = calCollLook.NextPos; TouchPostion = calCollLook.NextPos; towerNowPos.Y += 0.1f; if (towerPos.X == 0.0f && towerPos.Y == 0.0f && towerPos.Z == 0.0f) { towerPos = towerNowPos; effectPos = towerNowPos; //ctrlResMgr.CtrlTo.EntryAddTower( 1, 0.0f, towerNowPos, (int)StaticDataList.getRandom(0,5)); } double dis2 = Common.VectorUtil.Distance(towerPos, towerNowPos); if (dis2 > newTowerDis) { ctrlResMgr.AddWall = true; ctrlResMgr.AddWallPos1 = towerPos; ctrlResMgr.AddWallPos2 = towerNowPos; ctrlResMgr.AddTower = true; ctrlResMgr.AddTowerPos = towerNowPos; TowerAreaNorth = FMath.Max(TowerAreaNorth, towerNowPos.X); TowerAreaSouth = FMath.Min(TowerAreaSouth, towerNowPos.X); TowerAreaEast = FMath.Max(TowerAreaEast, towerNowPos.Z); TowerAreaWest = FMath.Min(TowerAreaWest, towerNowPos.Z); //AppSound.GetInstance().PlaySeCamDis( AppSound.SeId.MakeMo, towerNowPos ); towerPos = towerNowPos; //sumPos += towerPos; //sumcount++; } dis2 = Common.VectorUtil.Distance(effectPos, towerNowPos); if (dis2 > newEffectDis) { ctrlResMgr.AddEffectFromEnemy = true; ctrlResMgr.AddEnemyEffectPos = towerNowPos; effectPos = towerNowPos; } } } }
/// 継承メソッド ///--------------------------------------------------------------------------- /// 初期化 public override bool DoInit() { shapeMove = null; shapeMove = new ShapeSphere(); shapeMove.Init(1); shapeMove.Set( 0, StaticDataList.getVectorZero(), objWidth ); // titanModel = new BasicModel("/Application/res/data/3D/char/titan.mdx", 0); program = new BasicProgram() ; return true; }
/// 破棄 public override void DoTerm() { if( shapeMove != null ){ shapeMove.Term(); } shapeMove = null; // titanModel.Dispose(); program.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; vertices.Dispose(); spriteShader.Dispose(); }
/// public メソッド ///-------------------------------------------------------------------------- - /// 初期化 public bool Init() { boundingShape = new ShapeSphere(); boundingShape.Init( 1 ); boundingShape.Set( 0, new Vector3( 0.0f, 0.0f, 0.0f ), 1.0f ); deadFlag = false; changeFlag = false; glowNumber = 0; glowCounter = 0; appearCount = (int)Data.SetupValue.AppearAndLeaveTime; firstFlag = true; eatFlag = false; glowFinish = false; farFlag = false; rotation.Z = 0.0f; return( DoInit() ); }
/// private メソッド ///--------------------------------------------------------------------------- /// 目的地セット public void setDestination(int scrPosX, int scrPosY) { GameActorCollManager useCollMgr = actorDestination.GetMoveCollManager(); Vector3 posStart = new Vector3(0, 0, 0); Vector3 posEnd = new Vector3(0, 0, 0); /// チェックする開始座標と終了座標のセット ctrlResMgr.GraphDev.GetScreenToWorldPos(scrPosX, scrPosY, 0.0f, ref posStart); ctrlResMgr.GraphDev.GetScreenToWorldPos(scrPosX, scrPosY, 1.0f, ref posEnd); DemoGame.GeometryLine moveMoveLine = new DemoGame.GeometryLine(posStart, posEnd); /// 衝突対象の登録 useCollMgr.TrgContainer.Clear(); ctrlResMgr.CtrlHobit.SetDestinationActor(useCollMgr.TrgContainer); ctrlResMgr.CtrlTo.SetDestinationActor(useCollMgr.TrgContainer); ctrlResMgr.CtrlWall.SetDestinationActor(useCollMgr.TrgContainer); useCollMgr.TrgContainer.Add(actorStg, actorStg.GetUseObj(0)); /// 衝突判定 calCollLook.SetMoveType(Data.CollTypeId.ChDestination); bool checkBound = calCollLook.Check(useCollMgr, moveMoveLine); if (checkBound) { /// マーカーのセット actorDestination.Start(); Matrix4 mtx = Matrix4.RotationY(0); destinationTrgActor = useCollMgr.TrgContainer.GetEntryObjParent(0); ShapeSphere bndSph = destinationTrgActor.GetBoundingShape(); if (destinationTrgActor.CheckMoveTrgId() == 1) { if (bndSph != null) { destinationPos = bndSph.Sphre.Pos; } else { destinationPos = destinationTrgActor.BasePos; } actorDestination.SetType(0); } else if (destinationTrgActor.CheckMoveTrgId() == 2) { destinationPos = destinationTrgActor.BasePos; if (bndSph != null) { destinationPos.Y += bndSph.Sphre.R; } actorDestination.SetType(0); } else { destinationPos = calCollLook.NextPos; destinationPos.Y += 0.02f; actorDestination.SetType(1); } Common.MatrixUtil.SetTranslate(ref mtx, destinationPos); actorDestination.SetPlace(mtx); actorDestination.Enable = true; } else { actorDestination.Enable = 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 ); 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 bool Init( DemoGame.SceneManager sceneMgr ) { useSceneMgr = sceneMgr; calCollGrav = new ActorUnitCollGravity(); calCollGrav.Init(); moveCollMgr = new GameActorCollManager(); moveCollMgr.Init(); shapeMove = new ShapeSphere(); shapeMove.Init(1); shapeMove.Set( 0, StaticDataList.getVectorZero(), 0.001f ); renderSph = new DemoGame.RenderGeometry(); renderSph.MakeSphere(); /// trgObj = null; /// 移動する自身のOBJを登録 moveCollMgr.SetMoveShape( shapeMove ); trgObjMoveSpd = 1.0f; setPlaceTypeParam( trgObjType ); nowTaskId = debugMenuTaskId.SelectObj; changeTask( debugMenuTaskId.SelectObj ); return true; }
/// 破棄 public override void DoTerm() { if( shapeMove != null ){ shapeMove.Term(); } if( useMdlHdl != null ){ useMdlHdl.Term(); } shapeMove = null; useMdlHdl = null; }
/// 破棄 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; }
/// シーンの破棄 public void Term() { if( calCollGrav != null ){ calCollGrav.Term(); } if( moveCollMgr != null ){ moveCollMgr.Term(); } if( shapeMove != null ){ shapeMove.Term(); } if( renderSph != null ){ renderSph.Dispose(); } /// trgObj = null; renderSph = null; shapeMove = null; moveCollMgr = null; calCollGrav = null; useSceneMgr = null; }