public BepuEntity createTail(Vector3 pos, Vector3 offSet, float width, float height, float length) { tail = new BepuEntity(); tail.modelName = "cube"; tail.LoadContent(); tail.body = new Box(pos + offSet, width, length, height, 1); tail.localTransform = Matrix.CreateScale(width, length, height); Game1.Instance.Space.Add(tail.body); Game1.Instance.Children.Add(tail); return tail; }
public BepuEntity createRotor(Vector3 pos, Vector3 offSet, float width, float height, float length) { rotor = new BepuEntity(); rotor.modelName = "cube"; rotor.LoadContent(); rotor.body = new Box(pos + offSet, width, height, length, 1); rotor.localTransform = Matrix.CreateScale(width, height, length); Game1.Instance.Space.Add(rotor.body); Game1.Instance.Children.Add(rotor); return rotor; }
public BepuEntity createClawItemHolder4(Vector3 position, Vector3 offSet, float width, float height, float length) { clawItemHolder4 = new BepuEntity(); clawItemHolder4.modelName = "cube"; clawItemHolder4.LoadContent(); clawItemHolder4.body = new Box(position + offSet, width, height, length, 10); clawItemHolder4.localTransform = Matrix.CreateScale(width, height, length); Game1.Instance.Space.Add(clawItemHolder4.body); Game1.Instance.Children.Add(clawItemHolder4); return clawItemHolder4; }
public BepuEntity createClawHolder(Vector3 position, Vector3 offSet, float height, float radius) { clawHolder = new BepuEntity(); clawHolder.modelName = "cube"; clawHolder.LoadContent(); clawHolder.body = new Box(position + offSet, radius, height, radius, 100); clawHolder.localTransform = Matrix.CreateScale(radius, height, radius); Game1.Instance.Space.Add(clawHolder.body); Game1.Instance.Children.Add(clawHolder); return clawHolder; }
public BepuEntity createSkid2(Vector3 pos, Vector3 offSet, float width, float height, float length) { skid2 = new BepuEntity(); skid2.modelName = "cube"; skid2.LoadContent(); skid2.body = new Box(pos + offSet, width, height, length, 1); skid2.localTransform = Matrix.CreateScale(width, height, length); Game1.Instance.Space.Add(skid2.body); Game1.Instance.Children.Add(skid2); return skid1; }
public BepuEntity createSeeSawBoard(Vector3 position, float width, float height, float length) { seeSawBoard = new BepuEntity(); seeSawBoard.modelName = "cube"; seeSawBoard.LoadContent(); seeSawBoard.body = new Box(position, width, height, length, 1); seeSawBoard.localTransform = Matrix.CreateScale(width, height, length); seeSawBoard.diffuse = new Vector3((float)random.NextDouble(), (float)random.NextDouble(), (float)random.NextDouble()); Game1.Instance.Space.Add(seeSawBoard.body); Game1.Instance.Children.Add(seeSawBoard); return seeSawBoard; }
public BepuEntity createBall(Vector3 position, float radius) { ball = new BepuEntity(); ball.modelName = "sphere"; // Use the cube model ball.LoadContent(); ball.body = new Sphere(position, radius, 100); // Place it in the world and give it's dimensions ball.localTransform = Matrix.CreateScale(radius); // Scale the model ball.diffuse = new Vector3((float)random.NextDouble(), (float)random.NextDouble(), (float)random.NextDouble()); // Set the colour to a shade of yellow Game1.Instance.Space.Add(ball.body); // Add to the world Game1.Instance.Children.Add(ball); // Add to the list of entities return ball; }
public BepuEntity createSeeSawHolder(Vector3 position, float width, float height, float length) { seeSawHolder = new BepuEntity(); seeSawHolder.modelName = "cube"; seeSawHolder.LoadContent(); seeSawHolder.body = new Box(position, width, height, length, 20); seeSawHolder.body.BecomeKinematic(); seeSawHolder.localTransform = Matrix.CreateScale(width, height, length); seeSawHolder.diffuse = new Vector3((float)random.NextDouble(), (float)random.NextDouble(), (float)random.NextDouble()); Game1.Instance.Space.Add(seeSawHolder.body); Game1.Instance.Children.Add(seeSawHolder); return seeSawHolder; }
public BepuEntity createBox(Vector3 position, float width, float height, float length, float r, float g, float b, int mass, float orientation) { box = new BepuEntity(); box.modelName = "cube"; // Use the cube model box.LoadContent(); box.body = new Box(position, width, height, length, mass); // Place it in the world and give it's dimensions box.localTransform = Matrix.CreateScale(width, height, length); // Scale the model box.body.Orientation = Quaternion.CreateFromAxisAngle(new Vector3(0, orientation, 0), 1); box.diffuse = new Vector3(r, g, b); // Set the colour to a shade of yellow Game1.Instance.Space.Add(box.body); // Add to the world Game1.Instance.Children.Add(box); // Add to the list of entities return box; }
public BepuEntity createGround(Vector3 position, float width, float height, float length) { ground = new BepuEntity(); ground.modelName = "cube"; // Use the cube model ground.LoadContent(); ground.body = new Box(position, width, height, length); // Place it in the world and give it's dimensions ground.body.BecomeKinematic(); // Make the entity state ground.localTransform = Matrix.CreateScale(width, height, length); // Scale the model ground.diffuse = new Vector3(0.15f, 0.15f, 0.3f); // Set the colour to a shade of yellow Game1.Instance.Space.Add(ground.body); // Add to the world Game1.Instance.Children.Add(ground); // Add to the list of entities return ground; }
public BepuEntity createHelicopter(Vector3 position, float width, float height, float length) { helicopter = new BepuEntity(); helicopter.modelName = "cube"; helicopter.LoadContent(); helicopter.body = new Box(position, width, height, length, 1); helicopter.localTransform = Matrix.CreateScale(width, height, length); helicopter.diffuse = new Vector3(0.7f, 0.2f, 0.2f); helicopter.Look = new Vector3(1, 0, 0); helicopter.body.BecomeKinematic(); Game1.Instance.Space.Add(helicopter.body); Game1.Instance.Children.Add(helicopter); return helicopter; }
public BepuEntity createSlope(Vector3 position, float width, float height, float length) { slope = new BepuEntity(); slope.modelName = "cube"; // Use the cube model slope.LoadContent(); slope.body = new Box(position, width, height, length); // Place it in the world and give it's dimensions slope.body.Orientation = Quaternion.CreateFromAxisAngle(new Vector3(0, 0, 0.5f), 1); slope.body.BecomeKinematic(); // Make the entity state slope.localTransform = Matrix.CreateScale(width, height, length); // Scale the model slope.diffuse = new Vector3(0.3f, 0.3f, 0.45f); // Set the colour to a shade of yellow Game1.Instance.Space.Add(slope.body); // Add to the world Game1.Instance.Children.Add(slope); // Add to the list of entities return slope; }