Exemple #1
0
        BepuEntity createBox(Vector3 position, float width, float height, float length)
        {
            BepuEntity theBox = new BepuEntity();

            theBox.modelName = "cube";
            theBox.LoadContent();
            theBox.localTransform = Matrix.CreateScale(new Vector3(width, height, length));
            theBox.body           = new Box(position, width, height, length, 1);
            theBox.diffuse        = new Vector3((float)random.NextDouble(), (float)random.NextDouble(), (float)random.NextDouble());
            theBox.configureEvents();
            space.Add(theBox.body);
            children.Add(theBox);
            return(theBox);
        }
Exemple #2
0
        BepuEntity fireBall()
        {
            BepuEntity ball = new BepuEntity();

            ball.modelName = "sphere";
            float size = 1;

            ball.localTransform = Matrix.CreateScale(new Vector3(size, size, size));
            ball.body           = new Sphere(Camera.Position + (Camera.Look * 8), size, size * 10);
            ball.diffuse        = new Vector3((float)random.NextDouble(), (float)random.NextDouble(), (float)random.NextDouble());
            space.Add(ball.body);
            ball.LoadContent();
            ball.configureEvents();
            ball.body.ApplyImpulse(Camera.Position, Camera.Look * 500);
            children.Add(ball);
            return(ball);
        }
 BepuEntity fireBall()
 {
     BepuEntity ball = new BepuEntity();
     ball.modelName = "sphere";
     float size = 1;
     ball.localTransform = Matrix.CreateScale(new Vector3(size, size, size));
     ball.body = new Sphere(Camera.Position + (Camera.Look * 8), size, size * 100);
     ball.diffuse = new Vector3((float)random.NextDouble(), (float)random.NextDouble(), (float)random.NextDouble());
     space.Add(ball.body);
     ball.LoadContent();
     ball.configureEvents();
     ball.body.ApplyImpulse(Vector3.Zero, Camera.Look * 500);
     children.Add(ball);
     return ball;
 }
 BepuEntity createBox(Vector3 position, float width, float height, float length)
 {
     BepuEntity theBox = new BepuEntity();
     theBox.modelName = "cube";
     theBox.localTransform = Matrix.CreateScale(new Vector3(width, height, length));
     theBox.body = new Box(position, width, height, length, 1);
     theBox.diffuse = new Vector3((float)random.NextDouble(), (float)random.NextDouble(), (float)random.NextDouble());
     theBox.configureEvents();
     space.Add(theBox.body);
     children.Add(theBox);
     return theBox;
 }