protected string getFileName() { ModelBubble bubble = (ModelBubble)displayable; switch (bubble.color) { case BubbleColor.red: return("RedBubble"); case BubbleColor.blue: return("BlueBubble"); case BubbleColor.brown: return("BrownBubble"); case BubbleColor.green: return("GreenBubble"); case BubbleColor.orange: return("OrangeBubble"); case BubbleColor.teal: return("TealBubble"); case BubbleColor.yellow: return("YellowBubble"); } return("ball"); }
public void changeColor(BubbleColor color) { ModelBubble b = (ModelBubble)this.displayable; b.setColor(color); section = new Rectangle(locationX[(int)color], locationY[(int)color], dimensions.width, dimensions.height); }
public override void Draw(GameTime gameTime) { ModelBubble bubble = (ModelBubble)displayable; world = getBallRotation(); world *= Matrix.CreateTranslation(new Vector3(displayable.position.x, displayable.position.y, displayable.position.z)); world *= CameraHolder.camera.getWorldMatrix(); foreach (ModelMesh mesh in model.Meshes) { foreach (BasicEffect effect in mesh.Effects) { //effect.TextureEnabled = false; //effect.Texture = tempTexture; //effect.Texture = otherTexture; effect.EnableDefaultLighting(); effect.World = transformations[mesh.ParentBone.Index] * world; effect.View = CameraHolder.camera.getView(); effect.Projection = CameraHolder.camera.getProjection(); effect.Alpha = 1.0f; } mesh.Draw(); } base.Draw(gameTime); }
public Matrix getBallRotation() { ModelBubble bubble = (ModelBubble)displayable; Matrix rotations = Matrix.CreateRotationX(bubble.motionRotation.x); //rotations *= Matrix.CreateRotationY(bubble.motionRotation.y); rotations *= Matrix.CreateRotationZ(bubble.motionRotation.y); return(rotations); }
public ModelBubble(ModelBubble b) : base(b) { color = b.color; motionRotation = new Point(0.0f, 0.0f, 0.0f); }
public ModelBubble(ModelBubble b) : base(b) { color = b.color; }