Beispiel #1
0
        /// <summary>
        /// 新建一个模型
        /// </summary>
        /// <param name="aModel">父模型</param>
        /// <param name="game"></param>
        /// <param name="dModelType">读取的DModelType</param>
        public DModel(AODModel aModel, Game game, DModelType dModelType)
        {
            this.game = game;
            LoadType(dModelType);

            parentModel = aModel;
        }
Beispiel #2
0
 /// <summary>
 /// 新建一个模型并指定相对于父模型的参数
 /// </summary>
 /// <param name="aModel">父模型</param>
 /// <param name="game"></param>
 /// <param name="dModelType">读取的DModelType</param>
 /// <param name="scale">相对缩放</param>
 /// <param name="rotation">相对旋转矩阵</param>
 /// <param name="position">相对位置</param>
 public DModel(AODModel aModel, Game game, DModelType dModelType, float scale, Matrix rotation, Vector3 position, float alpha)
 {
     this.game = game;
     LoadType(dModelType);
     this.scale    = scale;
     this.rotation = rotation;
     this.position = position;
     parentModel   = aModel;
     this.alpha    = alpha;
 }
Beispiel #3
0
 /// <summary>
 /// 从一个DModelType中读取参数新建模型
 /// </summary>
 /// <param name="dModelType">需要读取的DModelType</param>
 void LoadType(DModelType dModelType)
 {
     try
     {
         model = game.Content.Load <Model>(dModelType.model);
     }
     catch
     {
         Console.WriteLine("无法读取模型");
     }
     name         = dModelType.name;
     this.dieTime = dModelType.dieTime;
 }
Beispiel #4
0
 /// <summary>
 /// 新建一个无父模型的模型
 /// </summary>
 /// <param name="game"></param>
 /// <param name="dModelType">读取的DModelType</param>
 public DModel(Game game, DModelType dModelType)
 {
     this.game = game;
     LoadType(dModelType);
 }