public PlayerSerpent( Game game, PlayingField pf, ModelWrapper modelHead, ModelWrapper modelSegment) : base(game, pf, modelHead, modelSegment, new Whereabouts(0, Point.Zero, Direction.East)) { _camera = new Camera( game.Window.ClientBounds, new Vector3(0, 20, 2), Vector3.Zero, CameraBehavior.FollowSerpent); }
public EnemySerpent( PlayingField pf, Model modelHead, Model modelSegment, Camera camera, Whereabouts whereabouts, int x) : base(pf, modelHead, modelSegment, whereabouts) { _whereabouts = whereabouts; _rnd.NextBytes(new byte[x]); _camera = camera; addTail(); addTail(); }
public void Draw( Camera camera, Matrix world, Vector3 tintColor, float tintFactor, float alpha ) { foreach (var mesh in _model.Meshes) { foreach (StockEffects.BasicEffect e in mesh.Effects) { e.DiffuseColor = Vector3.Lerp(e.OriginalDiffuseColor, tintColor, tintFactor); e.Alpha = alpha; e.View = camera.View; e.Projection = camera.Projection; e.World = _bones[mesh.ParentBone.Index]*world; } mesh.Draw(); } }
public override void Draw(Camera camera) { var transforms = new Matrix[model.Bones.Count]; model.CopyAbsoluteBoneTransformsTo(transforms); for (var i = 0; i < 20; i+=4 ) foreach (var mesh in model.Meshes) { foreach (BasicEffect be in mesh.Effects) { be.EnableDefaultLighting(); be.Projection = camera.Projection; be.View = camera.View; be.World = GetWorld() * mesh.ParentBone.Transform * //Matrix.CreateRotationZ(MathHelper.Pi) * Matrix.CreateScale(1.15f) * Matrix.CreateTranslation(i, 0, 21); } mesh.Draw(); } }
public virtual void Draw(Camera camera) { }
public void Draw( Camera camera ) { //Set object and camera info _effect.View = camera.View; _effect.Projection = camera.Projection; _effect.GraphicsDevice.SamplerStates[0] = new SamplerState() {Filter = TextureFilter.Linear}; _effect.World = Matrix.CreateTranslation( -0.5f, 0, -0.5f ); _effect.Texture = _texture; _effect.TextureEnabled = true; _effect.VertexColorEnabled = false; foreach (var pass in _effect.CurrentTechnique.Passes) { pass.Apply(); VertexBuffer.GraphicsDevice.SetVertexBuffer(VertexBuffer); VertexBuffer.GraphicsDevice.DrawPrimitives( PrimitiveType.TriangleList, 0, VertexBuffer.VertexCount); } _effect.TextureEnabled = false; _effect.VertexColorEnabled = true; foreach (var pass in _effect.CurrentTechnique.Passes) { pass.Apply(); VertexBufferShadow.GraphicsDevice.SetVertexBuffer(VertexBufferShadow); VertexBufferShadow.GraphicsDevice.DrawPrimitives( PrimitiveType.TriangleList, 0, VertexBufferShadow.VertexCount); } }
void Start() { pauseUICamera = GameObject.FindGameObjectWithTag("Pause UI Camera").GetRequiredComponent <Camera>(); pauseButton = GameObject.FindGameObjectWithTag("Pause button").GetRequiredComponent <Button>(); }
public ModelManager(Game game, Camera camera) : base(game) { _camera = camera; }