Hey all!
I got a question on collision boxes or spheres.. well im tryin to add a bounding sphere to my space ship, and trying to add a box as well for the wall collision as u see here…
Im a noob anyways but as i add a bounding sphere or a box, it goes and aligns to my space ship, which is good to put the sphere around it, but i need the bounding box to be stationary. what am i doing wrong here? thanks for any help :D
protected override void Draw(GameTime gameTime) { GraphicsDevice device = graphics.GraphicsDevice; device.Clear(Color.AliceBlue); GraphicsDevice.BlendState = BlendState.Opaque; GraphicsDevice.DepthStencilState = DepthStencilState.Default; GraphicsDevice.SamplerStates[0] = SamplerState.LinearWrap; DrawModel(shipModel, ship.World); DrawModel(terrain, Matrix.Identity); //DrawModel(shipModel2, Matrix.Identity); DrawOverlayText(); DebugShapeRenderer.AddBoundingSphere(sphere, Color.Red); DebugShapeRenderer.AddBoundingBox(bbox, Color.Yellow); DebugShapeRenderer.Draw(gameTime, view, projection); base.Draw(gameTime); } /// <summary> /// Simple model drawing method. The interesting part here is that /// the view and projection matrices are taken from the camera object. /// </summary> private void DrawModel(Model model, Matrix world) { Matrix[] transforms = new Matrix[model.Bones.Count]; model.CopyAbsoluteBoneTransformsTo(transforms); foreach (ModelMesh mesh in model.Meshes) { foreach (BasicEffect effect in mesh.Effects) { effect.EnableDefaultLighting(); effect.World = transforms[mesh.ParentBone.Index] * world; // Use the matrices provided by the chase camera effect.View = camera.View; effect.Projection = camera.Projection; } mesh.Draw(); } }