/// public メソッド ///--------------------------------------------------------------------------- /// モデルのセット public void SetMdlHandle(Data.FixTypeId fixTypeId, int lodLv) { if (nowLodLev != lodLv) { int fixTypeIdx = (int)fixTypeId; int mdlResId = (int)ObjFixLodData.LodModelTbl[fixTypeIdx, lodLv]; int texResId = (int)Data.ModelTexResId.Fix00 + fixTypeIdx; int shaResId = (int)Data.ModelShaderReslId.Normal; if (mdlResId >= (int)Data.ModelResId.Fix00) { Data.ModelDataManager resMgr = Data.ModelDataManager.GetInstance(); /// 速度アップのため、事前にテクスチャをバインドしておく useMdlHdl.StartNoBindTex(resMgr.GetModel(mdlResId), resMgr.GetTextureContainer(texResId), resMgr.GetShaderContainer(shaResId)); drawFlg = true; } else { drawFlg = false; } nowLodLev = lodLv; } }
/// 備品の登録 public void EntryAddFix(int fixResId, Vector3 rot, Vector3 scale, Vector3 pos) { Data.ModelDataManager resMgr = Data.ModelDataManager.GetInstance(); if (resMgr.GetModel((int)Data.ModelResId.Fix00 + fixResId) == null) { return; } ActorFixBase actorFix; Data.FixTypeId fixId = (Data.FixTypeId)fixResId; if (fixId == Data.FixTypeId.Fix00 || fixId == Data.FixTypeId.Fix01 || fixId == Data.FixTypeId.Fix03 || fixId == Data.FixTypeId.Fix04) { actorFix = new ActorFixWooden(); } else { actorFix = new ActorFixNormal(); } actorFix.Init(); actorFix.Start(); actorFix.SetMdlHandle(fixId); actorFixList.Add(actorFix); SetPlace((actorFixList.Count - 1), rot, scale, pos); }
/// public メソッド ///--------------------------------------------------------------------------- /// モデルの登録 public bool SetMdlHandle(Data.FixTypeId fixId) { fixTypeId = fixId; objFix.SetMdlHandle(fixId, 0); objFix.SetShapeColl(fixId); return(true); }
/// モデルのセット public void SetBeforehandMdlBindTex(Data.FixTypeId fixTypeId, int lodLv) { int fixTypeIdx = (int)fixTypeId; int mdlResId = (int)ObjFixLodData.LodModelTbl[fixTypeIdx, lodLv]; int texResId = (int)Data.ModelTexResId.Fix00 + fixTypeIdx; int shaResId = (int)Data.ModelShaderReslId.Normal; if (mdlResId >= (int)Data.ModelResId.Fix00) { Data.ModelDataManager resMgr = Data.ModelDataManager.GetInstance(); useMdlHdl.Start(resMgr.GetModel(mdlResId), resMgr.GetTextureContainer(texResId), resMgr.GetShaderContainer(shaResId)); } }
/// 境界ボリュームの作成 public void SetBoundingShape(Data.FixTypeId fixTypeId, Vector3 scale) { float val = 1.0f; if (scale.X > scale.Y) { val = (scale.X > scale.Z)? scale.X : scale.Z; } else { val = (scale.Y > scale.Z)? scale.Y : scale.Z; } Vector3 cpos = ObjFixLodData.GetBoundingCenterPos((int)fixTypeId); objWidth = ObjFixLodData.GetBoundingCenterWidth((int)fixTypeId) * val; boundingShape.Set(0, cpos, objWidth); boundingShape.SetMult(this.baseMtx); }
/// public メソッド ///--------------------------------------------------------------------------- /// モデルの登録 public bool SetMdlHandle( Data.FixTypeId fixId ) { fixTypeId = fixId; objFix.SetMdlHandle( fixId, 0 ); objFix.SetShapeColl( fixId ); return true; }
/// 衝突形状のセット public void SetShapeColl(Data.FixTypeId fixTypeId) { float[] posData = null; /// 当たりデータの展開 ///------------------------------- switch (fixTypeId) { case Data.FixTypeId.Fix00: posData = ShapeObj00Data.Positions; break; case Data.FixTypeId.Fix01: posData = ShapeObj01Data.Positions; break; case Data.FixTypeId.Fix02: posData = ShapeObj02Data.Positions; break; /// case Data.FixTypeId.Fix03: posData = ShapeObj03Data.Positions; break; case Data.FixTypeId.Fix04: posData = ShapeObj04Data.Positions; break; case Data.FixTypeId.Fix05: posData = ShapeObj05Data.Positions; break; case Data.FixTypeId.Fix06: posData = ShapeObj06Data.Positions; break; case Data.FixTypeId.Fix07: posData = ShapeObj07Data.Positions; break; case Data.FixTypeId.Fix08: posData = ShapeObj08Data.Positions; break; case Data.FixTypeId.Fix09: posData = ShapeObj09Data.Positions; break; case Data.FixTypeId.Fix10: posData = ShapeObj10Data.Positions; break; case Data.FixTypeId.Fix11: posData = ShapeObj11Data.Positions; break; case Data.FixTypeId.Fix12: posData = ShapeObj12Data.Positions; break; case Data.FixTypeId.Fix13: posData = ShapeObj13Data.Positions; break; case Data.FixTypeId.Fix14: posData = ShapeObj14Data.Positions; break; case Data.FixTypeId.Fix15: posData = ShapeObj15Data.Positions; break; case Data.FixTypeId.Fix16: posData = ShapeObj16Data.Positions; break; case Data.FixTypeId.Fix17: posData = ShapeObj17Data.Positions; break; case Data.FixTypeId.Fix18: posData = ShapeObj18Data.Positions; break; case Data.FixTypeId.Fix19: posData = ShapeObj19Data.Positions; break; } shapeColl.Term(); if (posData != null) { shapeColl.Init(posData.Length / 9); for (int i = 0; i < posData.Length / 9; i++) { Vector3 pos1 = new Vector3(posData[i * 9 + 0], posData[i * 9 + 1], posData[i * 9 + 2]); Vector3 pos2 = new Vector3(posData[i * 9 + 3], posData[i * 9 + 4], posData[i * 9 + 5]); Vector3 pos3 = new Vector3(posData[i * 9 + 6], posData[i * 9 + 7], posData[i * 9 + 8]); shapeColl.SetType(1); shapeColl.Add(pos1, pos2, pos3); } } ///------------------------------- SetBoundingShape(fixTypeId, new Vector3(1.0f, 1.0f, 1.0f)); }