Exemple #1
0
 /// <summary>
 /// Constructor of Door Class   
 /// </summary>
 /// <param name="device3d">this Form Device3D.device</param>
 /// <param name="mirror">boolean for mirror Texture</param>
 /// <param name="wall_Points">right_Lower Point of Rectangle Point</param>
 /// <param name="srcTexturePathe">Pathe of Texture Picture's in HDD</param>
 /// <param name="maxRotateAngle">this number is between 0~7 for Rotate 360 angle</param>
 /// <param name="drawStepX">drawing steps between i point's of x-coordinate</param>
 /// <param name="drawStepY">drawing steps between j point's of y-coordinate</param>
 /// <param name="drawStepZ">drawing steps between k point's of z-coordinate</param>
 public Door(Device device3d, bool mirror,
             threeAxisRectangle wall_Points, int drawStepX, int drawStepY, int drawStepZ,
             string srcTexturePathe, float maxRotateAngle)
     : base(device3d, mirror, wall_Points, drawStepX, drawStepY, drawStepZ, srcTexturePathe)
 {
     _maxRotateAngle = maxRotateAngle;
 }
 /// <summary>
 /// Constructor of window Class   
 /// </summary>
 /// <param name="device3d">this Form Device3D.device</param>
 /// <param name="mirror">boolean for mirror Texture</param>
 /// <param name="wall_Points">right_Lower Point of Rectangle Point</param>
 /// <param name="srcTexturePathe">Pathe of Texture Picture's in HDD</param>
 /// <param name="AlphaBlendOperation">Transparent Color's in window operation</param>
 /// <param name="openWindowTo">Translation window to this vector in opening state</param>
 /// <param name="maxTD">Maximum Distance for Translation</param>
 /// <param name="drawStepX">drawing steps between i point's of x-coordinate</param>
 /// <param name="drawStepY">drawing steps between j point's of y-coordinate</param>
 /// <param name="drawStepZ">drawing steps between k point's of z-coordinate</param>
 /// <param name="isTransparent">do you want your window texture's is the transparent?</param>
 public window(Device device3d, bool mirror, openTranslationVector openWindowTo, float maxTD,
             threeAxisRectangle wall_Points, int drawStepX, int drawStepY, int drawStepZ,
             string srcTexturePathe, bool isTransparent)
     : base(device3d, mirror, wall_Points, drawStepX, drawStepY, drawStepZ, srcTexturePathe)
 {
     maxTranslationDistance = maxTD;
     openTo = openWindowTo;
     _isTransparent = isTransparent;
 }
 public textureWall(Microsoft.DirectX.Direct3D.Device device3D, bool Mirror,
                    threeAxisRectangle wall_Points, int drawStepX, int drawStepY, int drawStepZ,
                    string srcTexturePathe)
 {
     _device3D = device3D;
     _texture = TextureLoader.FromFile(device3D, srcTexturePathe);
     //
     // don't divison of Zero
     _drawStepX = (drawStepX != 0) ? drawStepX : 1;
     _drawStepY = (drawStepY != 0) ? drawStepY : 1;
     _drawStepZ = (drawStepZ != 0) ? drawStepZ : 1;
     //
     _wall = wall_Points;
     //
     hasDepth = (wall_Points.Depth != 0);
     hasHeight = (wall_Points.Height != 0);
     hasWidth = (wall_Points.Width != 0);
     //
     // بخاطر رسم دیوار نرسیده به مختصات خواسته شده به یک اندازه ی گام
     // ابتدا یک گام به ابعاد غیر صفر اضافه می کنیم
     _wall.Depth += (hasDepth) ? _drawStepZ : 0;
     _wall.Height += (hasHeight) ? _drawStepY : 0;
     _wall.Width += (hasWidth) ? _drawStepX : 0;
     //
     // Set Size
     //
     trainWidth = _wall.Width / _drawStepX;
     trainHeight = _wall.Height / _drawStepY;
     trainDepth = _wall.Depth / _drawStepZ;
     //
     VertexDeclaration(Mirror);
     IndexDeclaration();
     //
     //
     //
     Radius = Math.Max(Math.Max(_drawStepX, _drawStepY), _drawStepZ) / 10;
 }