예제 #1
0
        //Creates a Game and new Scene instance as its active Scene
        public Game()
        {
            RL.InitWindow(640, 480, "THIS IS A MANS WORLD!!!");
            RL.SetTargetFPS(60);

            _gameTimer = new Timer();

            Raylib.Vector3 cameraPosition = new Raylib.Vector3(-10, -10, -10);
            Raylib.Vector3 cameraTarget   = new Raylib.Vector3(320, 240, 0);
            Raylib.Vector3 cameraUp       = new Raylib.Vector3(0, 0, 1);
        }
예제 #2
0
        // Returns corners of the box for vector3
        public List <Raylib.Vector3> Corners3()
        {
            List <Raylib.Vector3> corners = new List <Raylib.Vector3>(4);

            corners.Add(new Raylib.Vector3()); corners.Add(new Raylib.Vector3()); corners.Add(new Raylib.Vector3()); corners.Add(new Raylib.Vector3());
            corners[0] = min3D;
            corners[1] = new Raylib.Vector3(min3D.x, max3D.y, min3D.z);
            corners[2] = max3D;
            corners[3] = new Raylib.Vector3(max3D.x, min3D.y, min3D.z);
            return(corners);
        }
예제 #3
0
 // Calculate bounding region for vector3
 public void Fit(List <Raylib.Vector3> points)
 {
     // invalidate extents
     max3D = new Raylib.Vector3(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity);
     min3D = new Raylib.Vector3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity);
     // find min and max points for the vector3
     for (int i = 0; i < points.Count; i++)
     {
         min3D = Vector3.Min(min3D, points[i]);
         max3D = Vector3.Min(max3D, points[i]);
     }
 }
예제 #4
0
        public Game()
        {
            RL.InitWindow(1280, 760, "RPG Game");
            RL.SetTargetFPS(30);
            //RL.SetTargetFPS(60);
            //RL.SetTargetFPS(0);
            Raylib.Vector3 cameraPosition = new Raylib.Vector3(-10, -10, -10);
            Raylib.Vector3 cameraTarget   = new Raylib.Vector3(0, 0, 0);
            Raylib.Vector3 cameraUp       = new Raylib.Vector3(0, 0, 1);
            _gameTimer = new Timer();



            _camera = new Camera3D(cameraPosition, cameraTarget, cameraUp);
        }
예제 #5
0
 // Find the closest point for vector3
 public Raylib.Vector3 ClosestPoint(Raylib.Vector3 p)
 {
     return(Vector3.Clamp(p, min3D, max3D));
 }
예제 #6
0
 // This is checking for a vector3 if it is overlapping for a vector3
 public bool IsOverlapping3(Raylib.Vector3 p)
 {
     return(!(p.x < min3D.x || p.y < min3D.y || p.x > min3D.x || p.y > max3D.y));
 }
예제 #7
0
 // This will translate a object.
 public void Translate(Raylib.Vector3 vec3)
 {
     localTransform.Translate(vec3.x, vec3.y);
     UpdateTransform();
 }
예제 #8
0
 public static Raylib.Vector3 Clamp(Raylib.Vector3 t, Raylib.Vector3 a, Raylib.Vector3 b)
 {
     return(Max(a, Min(a, t)));
 }
예제 #9
0
 public static Raylib.Vector3 Max(Raylib.Vector3 a, Raylib.Vector3 b)
 {
     return(new Raylib.Vector3(Math.Max(a.x, b.x), Math.Max(a.y, b.y), Math.Max(a.z, b.z)));
 }