예제 #1
0
파일: Camera.cs 프로젝트: pr3luder/water3d
        public void Draw(LandscapeGeomipmap landscape, Object3D plane)
        {
            switch (Mode)
            {
            case "free":
                updateObject();
                break;

            case "follow":
                float minimum = Math.Max(landscape.getHeight(VEye), objective.Scene.SeaHeight);
                updateObject(minimum - 1.0f, true);
                followObjective();
                break;

            case "followFree":
                float minimum1 = Math.Max(landscape.getHeight(VEye), plane.getPosition().Y);
                updateObject(minimum1 - 1.0f, true);
                /*updateObject(getObjective().getPosition().Y + 0.5f);*/
                break;

            default:
                updateObject(landscape.getHeight(VEye));
                break;
            }
        }
예제 #2
0
 public PatchGeomipmap(LandscapeGeomipmap landscape, Vector3 pos, Matrix rotation, int heightX, int heightZ, int patchSize, int mapSize, int mapDetail)
     : base(landscape.Scene, pos, rotation, Vector3.One)
 {
     this.landscape    = landscape;
     this.patchSize    = patchSize;
     this.mapSize      = mapSize;
     this.mapDetail    = mapDetail;
     this.vertexDetail = 1;
     this.xRatioFull   = 1.0f / (mapSize + 1);
     this.zRatioFull   = 1.0f / (mapSize + 1);
     this.xRatioPatch  = 16.0f / (patchSize + 1);
     this.zRatioPatch  = 16.0f / (patchSize + 1);
     // Store Patch offsets for the heightmap.
     setObject(pos.X, pos.Y, pos.Z);
     // Store pointer to first byte of the height data for this patch.
     this.heightX = heightX;
     this.heightZ = heightZ;
     //this.worldX = worldX;
     //this.worldZ = worldZ;
     maxHeight = landscape.getHeightMap(heightX, heightZ);
     indexX    = (heightX * mapSize) / (mapSize * patchSize);
     indexZ    = (heightZ * mapSize) / (mapSize * patchSize);
     // Initialize flags
     initVertexBuffer();
     drawIndexedPrimitives();
     calculateBoundingSphere();
 }