public MekAdvanceSolarPanel(int id, string str) : base(id, str) { Model model = ContentManager.Get <Model>("Mekiasm/Models/AdvanceSolarPlane"); texture = ContentManager.Get <Texture2D>("Mekiasm/Textures/AdvanceSolarPlane"); for (int i = 0; i < eles.Count; i++) { BlockMesh blockMesh = new BlockMesh(); Matrix matrix = BlockMesh.GetBoneAbsoluteTransform(model.FindMesh(eles[i]).ParentBone); blockMesh.AppendModelMeshPart(model.FindMesh(eles[i]).MeshParts[0], matrix * Matrix.CreateScale(0.5f) * Matrix.CreateTranslation(0.5f, 0.5f, 0.5f), false, false, false, false, Color.White); mainMesh.AppendBlockMesh(blockMesh); boundingBoxes.Add(blockMesh.CalculateBoundingBox()); } }
public override BoundingBox[] GetCustomCollisionBoxes(SubsystemTerrain terrain, int value) { return(new BoundingBox[] { boundmesh.CalculateBoundingBox() }); }