コード例 #1
0
ファイル: WorldView.cs プロジェクト: beyonddiana/osmp-cs
        //! Draws hardcoded platern that we start over
        //! This is a temporary function since land will be migrated to the databse
        void DrawLandscape()
        {
            IPicker3dModel picker3dmodel = RendererFactory.GetPicker3dModel();

            int i, iy;

            // Gl.glMaterialfv(Gl.GL_FRONT, Gl.GL_AMBIENT_AND_DIFFUSE, new float[]{(float)rand.GetRandomFloat(0,1), 0.7f, 0.2f, 1.0f});
            Gl.glMaterialfv(Gl.GL_FRONT, Gl.GL_AMBIENT_AND_DIFFUSE, new float[] { 0.7f, 0.7f, 0.2f, 1.0f });

            int iLandCoord = 0;

            for (iy = -10; iy <= 10; iy++)
            {
                for (i = -10; i <= 10; i++)
                {
                    LandCoords[iLandCoord] = new Vector2(-10.0F + i * 1.0F, -10.0F + iy * 1.0F);
                    picker3dmodel.AddHitTarget(new HitTargetLandCoord(iLandCoord));

                    graphics.PushMatrix();

                    graphics.Translate(-10.0F + i * 1.0F, -10.0F + iy * 1.0F, MetaverseClient.GetInstance().fHeight - 0.5);
                    graphics.DrawCube();

                    graphics.PopMatrix();
                    iLandCoord++;
                }
            }
        }
コード例 #2
0
 public void AddHitTarget(Entity entity)
 {
     picker3dmodel.AddHitTarget(new HitTargetEntity(entity));
 }