我是微信提出的辞职,这个算是提前做餐饮的微信辞职一个月还不批提出辞职的依据吗

查看: 1822|回复: 1
2017年最新互助盘源码,地球村社区+手机自适应+大转盘抽奖
在线时间 小时
猫粉排名:1现金: $名声: 9000称号: 平民
众创业气氛极为浓郁的当下,越来越多的人士不断将目光投向潜力型的项目,值得关注的是,近期一个名为“地球村”的**平台的项目开始进入人们的视线,并频 频在创投领域引发关注。据悉,由于该平台的模式具有独特的优势,动态奖金规则也极为令人心动,正在酝酿一股前所未有的财富风潮。
一. 静态模式
财富通道(一)
提供帮助,即100-30000的阶段性开放。首单限额10-5000元,第二单限制10-10000元,第三单10-20000元,第四单30000元封顶。
申请帮助等待系统匹配,每日利息为1%。
财富通道(二)
首单限额10-5000元& && &&&第二单限额10-10000元, 第三单限额10-20000元,最高限额20000.
自由选择排对时间,排队中每日利息0.5%,匹配打款确认后每日利息1.5%,15天强制出局。
财富通道(三)
首单限额10-5000元& && &&&第二单限额10-10000元, 第三单限额10-20000元,最高限额20000.
购买后立即打款,第二天开始每天提款15%,持续提款10天,每月限购一次。
二. 自由市场
参与者不及时打款
1.平台规定打款时间为12小时,如果参与者超过3小时没有打款,领导人操作界面发出警告,参与者打款时间剩余3小时扔未打款,领导人可选择是否代替直属会员打款,代替打则得到该订单所有利息!
2.超出12小时不打款平台对该领导人做出100元奖金烧伤,且该订单将会进入自由市场,由进入自由市场的参与者抢单,抢单后需在3个小时内打款,打款后会得到此订单的利息!
三. 诚信积分系统
1.& &诚信积分低于12分时不可提款,低于50分不可提取奖金,可通过任务、推广新会员和诚信打款方式获得诚信积分。
2& &.做任务每周限做一次(不累计),每次获得5诚信积分。
3.& &推广有效新会员获得 2/每人 诚信积分。
4.& &1小时内打款奖励3诚信积分,两小时内打款奖励2诚信积分,3小时内打款奖励1诚信积分。
5& &.诚信积分可以为负数。
6.& &每月清零诚信积分,负数不变。
7.& &规定时间内未打款扣55诚信积分,领导人扣30诚信积分。
8.& &未按系统规定复投的扣60诚信积分。
9.&&虚假打款上传假图一次扣100诚信积分,领导人连带责任扣50诚信积分。
10. 会员封号领导人扣80诚信积分。
11. 诚信积分可做月底抽奖活动,有几率获得高额奖金。
四. 动态奖金
LV.1: 可拿一代直推奖10%领导奖3%
LV.2 :直推10人团队20人—可拿一代直推奖10%领导奖5%
LV.3:直推15人团队150人—多拿2代3%+3代1%+4代0.25%,领导奖提取限制40%。
LV.4:直推20人团队300人—1代7%、2代5%、3代3%、4代1%、5代,0.05%领导奖提取限制50%。
LV5:直推2个LV4或以上团队1000人,多拿无限代0.01%,领导奖提取限制60%
初级经理:直推4个LV5或以上团队2000人,领导奖提取限制70%。
中级经理:直推6个初级经理以上团队3000人,领导奖提取限制80%。
高级经理:直推10个中级经理或以上团队5000人,领导奖提取限制90%。
五. 平台规则
1.诚信积分低于12分时不可提款,低于50分不可提取奖金,可通过任务、推广新会员和诚信打款方式获得诚信积分。
2.& &排单消耗排单币
3.& &会员必须完善个人信息后才可排单。
4.& &系统匹配短信通知交易双方会员。
5.& &七天强制复投,确保平台稳健运行。
6.& &每个手机号只能注册一个账号,三代内同名玩家不可超过3个。
7.& &直推会员下单金额不高于领导人下单金额百分之30以上。
8.& &排单、提款需二级密码验证和手机短信验证。
9.& &排单后无法删除订单,请用非关键资金参与。
10.上传虚假凭证、收款确认超时永久封号,如发现对方有不诚信行为请立即向系统举报。被封号的会员旗下团队由上级接管。
11.&&领导人账号中没有订单的时间内,下属会员下单会造成领导奖流失。
12.&&超过24小时没有排队中的订单,打款上传假图的系统采取封号处理。
13.&&领导奖每天限提一次。
14.&&直推奖冻结15后可提取,领导奖冻结一月后可提取。
15.&&团队发展为1:3比例,如领导人有一个直推,该领导团队人数上限为3人,多出人员只计算团队人数不计奖金。
16.&&提款匹配时间为上午9:00-晚上21:00 。其他时间段内不可提款操作。每周六日系统例行维护暂停匹配。
17.&&买入基金1-12天匹配,卖出基金24小时内匹配。
程序所需环境:PHP5.4+MYSQL(IIS下不能搭建)
1.jpg (57.48 KB, 下载次数: 2)
17:35 上传
2.jpg (93.27 KB, 下载次数: 2)
17:35 上传
3.jpg (126.9 KB, 下载次数: 2)
17:35 上传
4.jpg (55.69 KB, 下载次数: 3)
17:35 上传
5.jpg (61.75 KB, 下载次数: 2)
17:35 上传
6.jpg (162.74 KB, 下载次数: 2)
17:35 上传
7.jpg (94.98 KB, 下载次数: 2)
17:35 上传
8.jpg (82.41 KB, 下载次数: 2)
17:35 上传
重要申明:
1. 本源码是大客户定制开发版,请您不要拿本版跟其他版本相比,绝对秒杀!
2. 本源码正在运营中,具体就不说了,绝对保证完美运营!
3. 购买本源码不提供搭建网站,该源码在其他平台均售价1000元++
4. 本源码完全开源,完全没有后门和木马(阿里云盾+360卫士检测通过验证)
5. 本源码存在可复制性,杜绝一切退款理由
6.本源码由发财猫技术从其他地方购买后修复完整无误,售价只需580元
如有需要,请联系QQ:8463625,发财猫QQ群:
把本文推荐给朋友或其他网站上,有用户注册将增加您在本站积分:200猫币
在线时间 小时
猫粉排名:917现金: $200名声: 0称号: 平民
正规、信誉、稳定,尽在发财猫 ※
Copyright &
发财猫() 版权所有 All Rights Reserved.
业务合作洽谈联系:QQ8463625Google Earth API开发者指南
我的图书馆
Google Earth API开发者指南
var center = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);var north = center.getLatitude() + .85;var south = center.getLatitude() - .85;var east = center.getLongitude() + .55;var west = center.getLongitude() - .55;var rotation = 0;var latLonBox = groundOverlay.getLatLonBox();latLonBox.setBox(north, south, east, west, rotation);ge.getFeatures().appendChild(groundOverlay);此例中,Google的logo被叠放在加州总部山景城的位置。地面覆盖的特点是始终吸附在地表,无论图像放在山脉还是河谷,如下图所示:创建屏幕覆盖屏幕覆盖是指图片固定在屏幕上,不像地面覆盖那样跟随地表起伏而变化。屏幕覆盖通常用来做logo、商标、图例等,其长宽尺寸由size属性决定。图像位置(screenXY属性)由图中的安置点(overlayXY属性)控制,其旋转角度由rotationXY属性决定。下列代码将用Google标志图来创建一个屏幕覆盖,并倾斜一定角度。var screenOverlay = ge.createScreenOverlay(&&);screenOverlay.setIcon(ge.createIcon(&&));screenOverlay.getIcon().setHref("/UploadFiles/JCYY/490.gif");// Set screen position in pixelsscreenOverlay.getOverlayXY().setXUnits(ge.UNITS_PIXELS);screenOverlay.getOverlayXY().setYUnits(ge.UNITS_PIXELS);screenOverlay.getOverlayXY().setX(400);screenOverlay.getOverlayXY().setY(200);// Rotate around object&s center pointscreenOverlay.getRotationXY().setXUnits(ge.UNITS_FRACTION);screenOverlay.getRotationXY().setYUnits(ge.UNITS_FRACTION);screenOverlay.getRotationXY().setX(0.5);screenOverlay.getRotationXY().setY(0.5);// Set object&s size in pixelsscreenOverlay.getSize().setXUnits(ge.UNITS_PIXELS);screenOverlay.getSize().setYUnits(ge.UNITS_PIXELS);screenOverlay.getSize().setX(300);screenOverlay.getSize().setY(75);// Rotate 45 degreesscreenOverlay.setRotation(45);ge.getFeatures().appendChild(screenOverlay);效果如下图所示:样式地图样式地图在一般情况为地标下提供两种状态:普通状态和高亮状态,分别由两种图标来表示,当用户在Google Earth中用鼠标在地标图案上经过时,图案会自动切换至高亮状态。下例代码中,地标在普通状态时,图案为三角形,当鼠标在地标上方经过时,其图案变为矩形。map = ge.createStyleMap(&styleMap& + counter);// Create icon normal for style mapnormal = ge.createIcon(&&);normal.setHref(&/UploadFiles/JCYY/777.png&);iconNormal = ge.createStyle(&styleIconNormal& + counter);iconNormal.getIconStyle().setIcon(normal); // Create icon highlight for style maphighlight = ge.createIcon(&&);highlight.setHref(&/UploadFiles/JCYY/050.png&);iconHighlight = ge.createStyle(&styleIconHighlight& + counter);iconHighlight.getIconStyle().setIcon(highlight); // Set normal and highlight for stylemapmap.setNormalStyleUrl(&#styleIconNormal& + counter);map.setHighlightStyleUrl(&#styleIconHighlight& + counter); // Apply to placemarkplacemark.setStyleUrl(&#styleMap& + counter);}管理地形、道路、边界当浏览器窗口加载Google Earth插件时,地形特征将被作为默认选项被显示,无需手动干预。并不是所有Google Earth图层特性被显示出来,如果要在浏览器内显示,那么下列JavaScript代码将教您怎么做:显示建筑三维模型ge.getLayerRoot().enableLayerById(ge.LAYER_BUILDINGS, true);隐藏建筑三维模型ge.getLayerRoot().enableLayerById(ge.LAYER_BUILDINGS, false);显示边界ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);隐藏边界ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, false);显示地形ge.getLayerRoot().enableLayerById(ge.LAYER_TERRAIN, true);隐藏地形ge.getLayerRoot().enableLayerById(ge.LAYER_TERRAIN, false);KML分析如果您手上有一段KML代码,那么就可以让Google Earth插件对其进行分析——用ge.parseKml对象把KML转换成JavaScript。示例代码如下:var pentagon = ge.parseKml(&?xml version="1.0" encoding="UTF-8"?&& +&kml xmlns="/kml/2.1"&& +&Placemark&& +&name&The Pentagon&/name&& +&Polygon&& +&extrude&1&/extrude&& +&altitudeMode&relativeToGround&/altitudeMode&& +&outerBoundaryIs&& +&LinearRing&& +&coordinates&& +-77.67,38.24,100 & +-77.02,38.03,100 & +-77.91,38.86,100 & +-77.16,38.,100 & +-77.93,38.43,100 & +-77.67,38.24,100& +&/coordinates&& +&/LinearRing&& +&/outerBoundaryIs&& +&innerBoundaryIs&& +&LinearRing&& +&coordinates&& +-77.26,38.56,100 & +-77.18,38.77,100 & +-77.24,38.92,100 & +-77.52,38.46,100 & +-77.43,38.51,100 & +-77.26,38.56,100& +&/coordinates&& +&/LinearRing&& +&/innerBoundaryIs&& +&/Polygon&& +&/Placemark&& +&/kml&&);ge.getFeatures().appendChild(pentagon);var la = ge.createLookAt(&&);la.set(38.867, -77.0565, 500, ge.ALTITUDE_RELATIVE_TO_GROUND, 0, 45, 900);ge.getView().setAbstractView(la);上述代码效果如下图所示:察看模型Google Earth插件支持立体模型(三维场景)。把三维模型导入Google Earth后,会自动转换格式、旋转角度、伸缩大小,以适应Google Earth的坐标系统。下列代码将加载一个Collada模型,并将其显示出来。(注:COLLADA的全名是“COLLAborative Design Activity”,是用来建立3D互动程序的一个文件格式,而此格式就叫做“dae”,全名是“digital asset exchange”。COLLADA主要定义一个开放式的XML Schema标准。也就是说,你在3D软件所建好的模型,只要透过COLLADA的外挂软件就可以输出成「dae」的档案,而这个档案所包含的内容就是以XML文字数据的形式来描述的。)placemark = ge.createPlacemark(&&);placemark.setName(&model&);model = ge.createModel(&&);ge.getFeatures().appendChild(placemark);loc = ge.createLocation(&&);model.setLocation(loc);link = ge.createLink(&&);// A textured model created in Sketchup and exported as Collada.var href = window.location.var pagePath = href.substring(0, href.lastIndexOf(&/&)) + &/&;link.setHref(pagePath + &splotchy_box.dae&);model.setLink(link);la = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);loc.setLatitude(la.getLatitude());loc.setLongitude(la.getLongitude());placemark.setGeometry(model);la.setRange(300);la.setTilt(80);ge.getView().setAbstractView(la);察看太空您可以创建程序来观察天空——星星、月亮、星座、星系……就像Google Earth里的Sky功能一样。当程序切换到天空模式时,界面也会自动切换。所有星空数据均被放置在虚拟圆形地球的内部,我们的视角切换到球形核心,抬头仰望便可一览苍穹。坐标&星空坐标由赤经和赤纬组成。赤经:从春分点沿着天赤道向东到天体时圈与天赤道的交点所夹的角度,成为该天体的赤经。赤经与时角不同,时角是由天子午圈向西量,而赤经是由春分点向东量,两者方向相反。赤经(Right ascension, RA; 符号:希腊字母α),天文学名词。指赤道坐标系的经向坐标,过天球上一点的赤经圈与过春分点的二分圈所交的球面角。天球上相当于地球经线的线,通过 天球两极并与天赤道垂直。以时、分、秒表示。赤纬:从天赤道沿着天体的时圈至天体的角度称为该天体的赤纬。以天赤道为赤纬0°,向北为正,向南为负,分别从0°到90°。日赤纬的变化范围在-23°27&~+23°27&之间,而月赤纬的最大变化范围为-28°36&~+-28°36&.赤纬常用δ表示。在第二赤道坐标系中,天体的位置根据规定用经纬度来表示,称作赤经(α)、 赤纬(δ)。赤纬就是天体的位置与天赤道位置的差,在天赤道以北多少度就为正多少度,反之,在天赤道以南多少度为负多少度。赤纬的取值为-90度到+90度,南天极的赤纬为-90度,北天极的赤纬为+90度,天赤道的赤纬为0度。天球赤道坐标系的纬度规定与地球纬度类似。只是不称作“南纬”和“北纬”,天球赤纬以北纬为正,以南为负。用set方法把地球界面切换至天空:ge.getOptions().setMapType(ge.MAP_TYPE_SKY);反之,把界面从天空切换回地球:ge.getOptions().setMapType(ge.MAP_TYPE_EARTH);计算LookAt对象里的Range值&当您使用LookAt对象来处理星空数据时,必须用下列公式计算出r的距离。r = R*(k*sin(β/2) - cos(β/2) + 1)公式中各参数说明如下:r:即range的值,由&LookAt&标签指定。R:为假设星空球体的半径。在这里,星空球面为地球内表面,“ Center of Earth”为地球核心,因此R值实为地球半径6.378×106。k:等于1 / tan ( 2 / α),或者用近似数替代:1.1917536α:是一个角度范围(β&α&180°)。当观察点向地球原点移动时所形成的夹角。β:用户所需星空图像两边与地球原点的夹角(单位:秒)。与Google Maps相结合如果您是一位Google Maps开发者,想把网络地图移植到Google Earth插件里以增强互动效果,现在变得轻而易举。Google Maps API为Gmap2类增加了一个新方法,为Gmap类型增加了一个新常量,允许你在已有的网络地图中增加Google Earth三维功能。下例中,网页中的Google Map新增了一个“Earth”按钮,可以随时在Map与Earth之间切换。当您点击“Earth”按钮时,窗口切换至Google Earth,地点未变。示例代码如下:&&!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&&html xmlns="http://www.w3.org/1999/xhtml"xmlns:v="urn:schemas-microsoft-com:vml"&&head&&title&Using Google Earth API with the Maps API&/title&&script src="/maps?file=api&v=2.x&key=abcdefg"type="text/javascript"&&/script&function initialize() {var map = new GMap2(document.getElementById("map"));map.setCenter(new GLatLng(37.4419, -122.1419), 13);map.addMapType(G_SATELLITE_3D_MAP);map.addControl(new GHierarchicalMapTypeControl());// Uncomment the following line to start the map with 3D enabled.// map.setMapType(G_SATELLITE_3D_MAP);// Obtain a pointer to the Google Earth instance attached to// your map.map.getEarthInstance(getEarthInstanceCB);}function getEarthInstanceCB(object) {ge =// You can now manipulate ge using the full Google Earth API.}&/script&&/head&&body onload="initialize()" onunlaod="GUnload"&&div id="map" class="map" style="width:500height:350px"&&/div&&/body&&/html&大家从以上代码可以看出,在已有地图中添加新类型,只需调用gMap.addMapType(G_SATELLITE_3D_MAP)。如果您的地图上有按钮条,那么上述代码就会在按钮条中新增一项“Earth”,当用户点击它,地球窗口就会显示出来,各种标记、图形、文本等提示框,均能在地球窗口内正常显示。除了addMapType,您还可以用gMap.setMapType(G_SATELLITE_3D_MAP)直接把地图切换至Google Earth。同样,调用gMapType.setMapType()可以隐藏Google Earth窗口,地图切换到其他类型。分享到:&&&&&&&&阅读(314)|&评论()|&引用(0)&|举报&&历史上的今天相关文章
TA的最新馆藏[转]&[转]&[转]&[转]&[转]&[转]&下载本站需要懂及相关技术,不懂请勿下载,本站只保证源码完整,不提供技术支持;
源码请使用(以上)版本打开,请登陆!请参考;
点击&普通(VIP)会员”下载源码,扣除所需积分(0积分免费),1月内多次下载不重复扣分;
下载本站素材,即表示您已同意本站,造成的所有问题与本站无关;
推荐使用解压软件WinRAR解压本站资源;如果此源码无法下载,请点击提交报错
未经允许,禁止其他网站转载和盗链本站素材资源!
栏目下载排行
下载:6678 次
下载:5350 次
下载:3926 次
下载:3572 次
下载:3097 次
下载:2920 次
下载:2599 次
下载:2167 次
下载:1867 次
下载:1772 次
Powered by
Copyright & 2007 -使用ogre cegui和fmod编写的一个简单游戏界面系统 - 开源中国社区
当前访客身份:游客 [
当前位置:
发布于 日 13时,
使用ogre&cegui和fmod编写的一个简单游戏界面系统,包括主界面、人物界面、载入界面等。进入游戏为一个星球动画,按esc键打开退出界面,其他操作和说明见readme.txt。使用VS2008编写,使用windows&xp/7平台,&需要ogre&cegui和fmod的sdk。参考文献在代码中说明。程序中所有资源均来自因特网和其他游戏、软件,请勿用于商业用途。下载地址为http://download.csdn.net/detail/jajupmochiwxxz/6592593。Copyright&(C)&2013&Finaldream&Game&Studio。
代码片段(22)
define.cpp&~&878B&&&&
#include "defines.h"
using namespace FinalE
SoundSystem mySoundS // 声音系统
GuiSystem* myGuiSys = GuiSystem::getSingletonPtr(); // 界面系统
float gTimeFactor = 1; // 系统时间与真实时间速度比例
Final3DParams gF3DP // // 传递参数结构
TimeDef gTimeDef = {0, 0, 0, 0, 0}; // 时间定义
PhaseMark gPhaseMark = HealthyG // 游戏进行到各阶段的标志
// 一些物理学常量
long double gGfactor = 6.67259 / .0; // 牛顿引力常数(单位为m^3/kg/s^2)
long double gSunMass = 1989 * pow(10.0, 27.0); // 太阳质量(单位为kg)
long double gSunRadius = 696 * pow(10.0, 6.0); // 太阳半径(单位为m)
long double gSun2Earth = 1.4959787 * pow(10.0, 11.0); // 日地平均距离(单位为m)
float gEarthRadius = ; // 地球半径(单位为m)
float gMoonRadius = 1737400; // 月球半径(单位为m)
float gMoon2Earth = ; // 地月平均距离(单位为m)
defines.h&~&2KB&&&&
#ifndef _FD_DEFINES_H_
#define _FD_DEFINES_H_
#include "stdafx.h"
#include "SoundSystem.h"
#include "GuiSystem.h"
using namespace FinalE
// 一些外部声明
extern SoundSystem mySoundS
extern GuiSystem* myGuiS
extern float gTimeF
struct TimeDef // 定义各阶段所需的时间参数
float startT // 系统启动时间(相对于计算机启动时间)
float gameStartT // 开始进行游戏内容的时间(相对于计算机启动时间)
float systemT // 系统时间,系统启动后经过的时间
float gameT // 游戏经过的时间
SYSTEMTIME localT // 当地实际时间
float finalLogoStartT //
extern TimeDef gTimeD
struct Final3DParams // 用于Application和FrameListener之间传递参数的结构(创建帧听器时)
以下各项均是传递的参数
SceneNode* EarthN // 地球节点
Entity* E // 地球实体
SceneNode* MoonN // 月球节点
SceneNode* SunN // 太阳节点
SceneNode* RevSunN // 绕日公转节点(太阳节点的子节点),所有需要绕日公转的星球均挂在其下。
Ogre::RaySceneQuery* mRaySceneQ // 射线查询
Ogre::AnimationState* mAnimS // ogre实体动画状态
bool mC // 是否继续渲染
bool mStartT // 是否开始轨迹动画
bool mExitUI; // 是否退出UI
SceneNode* mCurrentN // 当前点击节点
Ogre::AnimationState* mCharaAnimS // 角色动画状态
Ogre::AnimationState* mBackupCharaAnimS // 备用角色动画状态
CEGUI::AnimationInstance* animInst1;
CEGUI::AnimationInstance* animInstS
int eggC // 主菜单时计数空格键按下次数,以激活彩蛋
SceneNode* mCharaN // 创建角色时的角色节点
SceneNode* mCamN // 当前绑定到摄像机的场景节点
extern Final3DParams gF3DP
// 声音内容的定义
enum SoundID
SpaceSound = 0, // He's a Pirate.mp3
EarthSound = 1, // Going Home.mp3
MoonSound = 2, // Fly Me To The Moon.mp3
SunSound = 3, // I See The Light.mp3
MarsSound = 4, // A Thousand Years.mp3(电影Red Planet插曲)
EarthSound2 = 5 // far away from home.mp3
// 射线查询,用于区分不同种射线
enum QueryMask
QUERY_MASK = 1&&0, // 可查询
HIDE_MASK = 1&&1
// 不可查询
// 游戏进行到各阶段的标志
enum PhaseMark
HealthyGaming,
FinalLogo,
CreateChara,
IntroChara,
FinishIntro,
BeginScene,
FinalLogoJumpIn,
FinalLogoShade
extern PhaseMark gPhaseM
Final3DApplication.cpp&~&11KB&&&&
#include "Final3DApplication.h"
using namespace O
// Start of FinalEngine namespace section
namespace FinalEngine
void Final3DApplication::go(void)
if (!setup())
startRendering();
// clean up
destroyScene();
bool Final3DApplication::setup(void)
String pluginsP
// only use plugins.cfg if not static
#ifndef OGRE_STATIC_LIB
#if OGRE_DEBUG_MODE
pluginsPath = mResourcePath + "plugins_d.cfg";
pluginsPath = mResourcePath + "plugins.cfg";
// 创建root对象
mRoot = OGRE_NEW Root(pluginsPath,
mConfigPath + "ogre.cfg", mResourcePath + "Ogre.log");
#ifdef OGRE_STATIC_LIB
mStaticPluginLoader.load();//////////////////////////////////////////////////////////////
setupResources();
bool carryOn = configure();
if (!carryOn)
chooseSceneManager();
createCamera();
createViewports();
#ifdef USE_RTSHADER_SYSTEM
// Initialize shader generator.
carryOn = initializeShaderGenerator(mSceneMgr);////////////////////////////////////////////////////
if (!carryOn)
// Set default mipmap level (NB some APIs ignore this)
TextureManager::getSingleton().setDefaultNumMipmaps(5);
// Create any resource listeners (for loading screens)
createResourceListener();
// Load resources
loadResources();
// Create the scene
createScene();
createFrameListener();
void Final3DApplication::setupResources(void)
// Load resource paths from config file
#if OGRE_DEBUG_MODE
cf.load(mResourcePath + "resources_d.cfg");
cf.load(mResourcePath + "resources.cfg");
// Go through all sections & settings in the file
ConfigFile::SectionIterator seci = cf.getSectionIterator();
String secName, typeName, archN
while (seci.hasMoreElements())
// Returns the next(=current) key element in the collection, without advancing to the next.
secName = seci.peekNextKey();
// Returns the next(=current) value element in the collection, and advances to the next.
ConfigFile::SettingsMultiMap *settings = seci.getNext();
ConfigFile::SettingsMultiMap::
for (i = settings-&begin(); i != settings-&end(); ++i)
typeName = i-&
archName = i-&
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_IPHONE
// OS X does not set the working directory relative to the app,
// In order to make things portable on OS X we need to provide
// the loading with it's own bundle path location
if (!StringUtil::startsWith(archName, "/", false)) // only adjust relative dirs
archName = String(macBundlePath() + "/" + archName);
// add a resource location to for a given resource group.
ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
bool Final3DApplication::configure(void)
// Show the configuration dialog and initialise the system
// You can skip this and use root.restoreConfig() to load configuration
// settings if you were sure there are valid ones saved in ogre.cfg
// #if OGRE_DEBUG_MODE
if(mRoot-&showConfigDialog())/////////////////////////////////////////////////////////////////////////////////////
if(mRoot-&restoreConfig())
// If returned true, user clicked OK so initialise
// 此处初始化窗口
// Here we choose to let the system create a default rendering window by passing 'true'
mWindow = mRoot-&initialise(true, "Solar System - 我的游戏");////////////////////////////////////////////////////////////////////////////
void Final3DApplication::chooseSceneManager(void)
// Create the SceneManager, in this case a generic one
mSceneMgr = mRoot-&createSceneManager(ST_GENERIC, "Final3DSMInstance");
void Final3DApplication::createCamera(void)
// 在默认位置创建摄像机
mCamera = mSceneMgr-&createCamera("PlayerCamera");///////////////////////
// 设置摄像机位置和方向
// Position it at 500 in Z direction
mCamera-&setPosition(Vector3(0,0,500));
// Look back along -Z
mCamera-&lookAt(Vector3(0,0,-300));
// 设置近距离剪裁
mCamera-&setNearClipDistance(5);
void Final3DApplication::createViewports(void)
// Create one viewport, entire window
Viewport* mainVp = mWindow-&addViewport(mCamera);
// 设置背景色(白色透明)
mainVp-&setBackgroundColour(ColourValue(0, 0, 0));
// Alter the camera aspect ratio to match the viewport
mCamera-&setAspectRatio(
Real(mainVp-&getActualWidth()) / Real(mainVp-&getActualHeight()));
void Final3DApplication::createScene(void)
// 界面系统初始化
myGuiSys-&cegui_Init();
// 播放音乐,初始化
mySoundSys.fmod_Init();
PlaySound("F:\\课外学习\\something fun\\three-body simulation\\SolarSystem\\Sounds\\He's a Pirate.wav", NULL,
SND_FILENAME | SND_ALIAS
|SND_ASYNC | SND_LOOP);
_sleep(1000);
// 创建射线查询
// gF3DParams.mRaySceneQuery = mSceneMgr-&createRayQuery(Ray());
// 创建粒子系统
// createParticle();
// 设置系统时间与真实时间速度比例
gTimeFactor = 1000.0;
// 设置绑定主摄像机的节点
//SceneNode* mMainCamNode = mSceneMgr-&getRootSceneNode()-&createChildSceneNode("MainCamNode", Vector3(0, 0, 230));
//mMainCamNode-&attachObject(mCamera);
//init3dScene();
/************************************************************************/
/* 测试代码
/************************************************************************/
gF3DParams.mCurrentNode = mSceneMgr-&getRootSceneNode()-&createChildSceneNode();
gF3DParams.mCurrentNode = gF3DParams.EarthN
gF3DParams.Earth-&setQueryFlags(QUERY_MASK);
mCamera-&setQueryFlags(HIDE_MASK);
// createTrackAnimation();
} // 函数createScene结束
void Final3DApplication::createFrameListener(void)
// 创建帧听器实例
#if OGRE_PLATFORM == OGRE_PLATFORM_IPHONE
mFrameListener= new ExampleFrameListener(mWindow, mCamera, true, true, true);
mFrameListener = new Final3DFrameListener(mWindow, mCamera, mSceneMgr);///////////////////////
// 把帧听器注册到Root对象中
mRoot-&addFrameListener(mFrameListener);
//!Unclear/////////////////怎么没用?///////////////////////////////////////////////////////////
// 在左下角显示帧率
//mFrameListener-&showDebugOverlay(true);
} // 函数createFrameListener结束
void Final3DApplication::startRendering(void)
assert(mRoot-&getRenderSystem() != 0);
mRoot-&getRenderSystem()-&_initRenderTargets();
// Clear event times
mRoot-&clearEventTimes();
gameProgress();
void Final3DApplication::gameProgress(void)
// 载入游戏开始时的GUI
setupStartGui();
// 设置主选单
setupMainMenu();
// Infinite loop, until broken out of by frame listeners
// or break out by calling queueEndRendering()
while (gF3DParams.animInst1-&isRunning())
if (!renderOneFrame())
} // End of FinalEngine namespace section
// 创建第二个摄像机节点和pitch节点
//node = mSceneMgr-&getRootSceneNode()-&createChildSceneNode("CamNode2", Vector3(0, 200, 400));
//node = node-&createChildSceneNode("PitchNode2");
//// 设置有向光
//Light* light = mSceneMgr-&createLight("Light3");
//light-&setType(Light::LT_DIRECTIONAL);
//light-&setDiffuseColour(ColourValue(.25, .25, 0));
//light-&setSpecularColour(ColourValue(.25, .25, 0));
//// 设置光的方向(无需设置光源距离)
//light-&setDirection(Vector3(0, -1, 1));
// 设置聚光灯
/*light = mSceneMgr-&createLight("Light2");
light-&setType(Light::LT_SPOTLIGHT);
light-&setDiffuseColour(0, 0, 1.0);
light-&setSpecularColour(0, 0, 1.0);
light-&setDirection(-1, -1, 0);
light-&setPosition(Vector3(300, 300, 0));
light-&setSpotlightRange(Degree(35), Degree(50));*/
// 设置背景色用于雾化效果
ColourValue fadeColour(0.9, 0.9, 0.9);
mWindow-&getViewport(0)-&setBackgroundColour(fadeColour);
// 设置线性雾,浓度变化范围为50到500
mSceneMgr-&setFog(FOG_LINEAR, fadeColour, 0.0, 50, 300); // 50内无雾,50到500雾线性变浓,500以外全是雾
// 设置指数雾
//mSceneMgr-&setFog(FOG_EXP2, fadeColour, 0.005); // 雾的密度
// 生成地面
mSceneMgr-&setWorldGeometry("terrain.cfg");
//// 设置天空面
//Plane skyP
//skyPlane.d = 10; // 设置距离
//skyPlane.normal = Vector3::NEGATIVE_UNIT_Y;
//mSceneMgr-&setSkyPlane(true, skyPlane, "Examples/CloudySky",
// 100, // 天空面大小()
// 45, // 贴图重复次数
// true, 0.5f, // 天空面弯度
// 150, 150 // x和y的分段数量
// 设置天空盒
//mSceneMgr-&setSkyBox(true, // 启用天空盒
//"Examples/SpaceSkyBox", 5000, // 天空盒与摄像机的距离
//false); // 最后渲染天空盒
// 设置天空穹
//mSceneMgr-&setSkyDome(true, "Examples/CloudySky", 5, // 天空穹的弯度
// 8, // 贴图重复的次数
// 4000, false);
// 添加ninja模型
// 创建实体
//Entity* ent = mSceneMgr-&createEntity("Ninja", "ninja.mesh");
//// 创建根节点下的场景节点并与实体绑定
//SceneNode* node = mSceneMgr-&getRootSceneNode()-&createChildSceneNode("NinjaNode");
//node-&attachObject(ent);
// 旋转实体绑定的节点
//ent-&getParentSceneNode()-&yaw(Degree(180));
//// 设置绑定摄像机的节点
//node = mSceneMgr-&getRootSceneNode()-&createChildSceneNode("MainCamNode", Vector3(-400, 200, 400));
//node-&yaw(Degree(-45));
//// 设置pitch节点
//node = node-&createChildSceneNode("MainPitchNode");
//node-&attachObject(mCamera);
// 创建第二个摄像机节点和pitch节点
//node = mSceneMgr-&getRootSceneNode()-&createChildSceneNode("CamNode2", Vector3(0, 200, 400));
//node = node-&createChildSceneNode("PitchNode2");
// 允许实体投射阴影
//ent-&setCastShadows(true);
// 创建一个平面
//Plane plane(Vector3::UNIT_Y, 0); // 参数为法线方向和与原点的距离
// 注册平面(创建一个平面模型)
//MeshManager::getSingleton().createPlane("ground", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
// plane, 1, 20, 20, true, 1, 50, 50, Vector3::UNIT_Z);
// 用以上模型创建平面实体
//ent = mSceneMgr-&createEntity("GroundEntity", "ground");
//mSceneMgr-&getRootSceneNode()-&createChildSceneNode()-&attachObject(ent);
// 设置材质
//ent-&setMaterialName("Examples/Rockwall");
//ent-&setCastShadows(false);
/*// 创建实体
Entity* ent1 = mSceneMgr-&createEntity("Robot", "robot.mesh");
// 允许实体投射阴影
ent1-&setCastShadows(true);
// 创建根节点下的场景节点
SceneNode* node1 = mSceneMgr-&getRootSceneNode()-&createChildSceneNode("RobotNode");
// 绑定实体与场景节点
node1-&attachObject(ent1);
// 创建另一个带有方位信息的节点
Entity* ent2 = mSceneMgr-&createEntity("Beauty", "beauty.mesh");
SceneNode* node2 = node1-&createChildSceneNode("RobotNode2", Vector3(50, 0, 0));
node2-&attachObject(ent2);
// 移动节点位置
node2-&translate(Vector3(10, 0, 10)); // 只有node2移动
node1-&translate(Vector3(25, 0, 0)); // node1,node2同时移动(因为node2是node1的子节点)
// 缩放实体
node1-&scale(.5, 1, 2);
node2-&scale(200, 100, 50);
// 旋转实体
node1-&yaw(Degree(-90));
node2-&yaw(Degree(-90));
node2-&pitch(Degree(180));
node2-&roll(Degree(180));*/
Final3DApplication.h&~&5KB&&&&
Final3DApplication:
@description: 3d render system of Final Engine.
@author: 贾林林
@reference:
1. OGRE+CEGUI游戏教程(2)----NPC对话演示 - Ai - 博客频道 - CSDN_NET, .
2. OGRE+CEGUI游戏教程(3)----角色创建 - Ai - 博客频道 - CSDN_NET, .
#ifndef _FD_FINAL3DAPPLICATION_H_
#define _FD_FINAL3DAPPLICATION_H_
#include "stdafx.h"
#include "defines.h"
#include "SoundSystem.h"
#include "Final3DFrameListener.h"
using namespace O
// Start of FinalEngine namespace section
namespace FinalEngine
class Final3DApplication
Final3DApplication()
: mFrameListener(0), mRoot(0)
// 初始化资源、设置文件路径
// Provide a nice cross platform solution for locating the configuration files
// On windows files are searched for in the current working directory, on OS X however
// you must provide the full path, the helper function macBundlePath does this for us.
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
mResourcePath = macBundlePath() + "/Contents/Resources/";////////////////////////////////////
mConfigPath = mResourceP
#elif OGRE_PLATFORM == OGRE_PLATFORM_IPHONE
mResourcePath = macBundlePath() + "/";///////////////////////////////////////////////////////////
mConfigPath = mResourceP
mResourcePath = "";
mConfigPath = mResourceP
#ifdef USE_RTSHADER_SYSTEM
mShaderGenerator
///////////////////////////////////////////////////////////////////
mMaterialMgrListener = NULL;///////////////////////////////////////////////////////////////////////
virtual ~Final3DApplication()
if (mFrameListener)
delete mFrameL
if (mRoot)
OGRE_DELETE mR
#ifdef OGRE_STATIC_LIB
mStaticPluginLoader.unload(); //////////////////////////////////////////////////////////////////////////////
// 开始程序/程序入口
virtual void go(void);
protected:
// These internal methods package up the stages in the startup process
/** Sets up the application - returns false if the user chooses to abandon configuration. */
virtual bool setup(void);
/// Method which will define the source of resources (other than current folder)
virtual void setupResources(void);
/** Configures the application - returns false if the user chooses to abandon configuration. */
virtual bool configure(void);
// 选择场景管理器
virtual void chooseSceneManager(void);
// 创建摄像机
virtual void createCamera(void);
// 创建视口
virtual void createViewports(void);
// Optional override method where you can create resource listeners (e.g. for loading screens)
virtual void createResourceListener(void) {}
/// Optional override method where you can perform resource group loading
/// Must at least do ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
virtual void loadResources(void)
// Initialise, parse scripts etc
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
// 创建场景
virtual void createScene(void);
// 创建帧听器
virtual void createFrameListener(void);
// 开始渲染
void startRendering(void);
游戏执行流程
此函数实现游戏从开始到结束的整个逻辑流程,由startRendering()调用
逻辑包含GUI、声音、3d动画等
virtual void gameProgress(void);
// 渲染一帧动画,在设定好资源和渲染内容后调用,一般要循环一定次数
bool renderOneFrame(void)
//Pump messages in all registered RenderWindow windows
WindowEventUtilities::messagePump();
return mRoot-&renderOneFrame();
virtual void destroyScene(void) {}
// Optional to override this
protected:
// 设置游戏开始时的GUI
virtual void setupStartGui(void) {}
// 设置主选单
virtual void setupMainMenu(void) {}
// 初始化3D场景
virtual void init3dScene(void) {}
protected:
#ifdef OGRE_STATIC_LIB
StaticPluginLoader mStaticPluginL//////////////////////////////////////////////////////////
Camera* mC
SceneManager* mSceneM
ExampleFrameListener* mFrameL
RenderWindow* mW
Ogre::String mResourceP
Ogre::String mConfigP
#ifdef USE_RTSHADER_SYSTEM
RTShader::ShaderGenerator*
// The Shader generator instance.//////////////////////
ShaderGeneratorTechniqueResolverListener* mMaterialMgrL
// Material manager listener. ///////////////////////
CEGUI::Animation* // GUI动画
CEGUI::AnimationInstance* animI // GUI动画实例
CEGUI::AnimationInstance* animInst2; // GUI动画实例备用
CEGUI::AnimationInstance* animInst3;
SceneNode* // 场景节点
Entity* // 实体
} // End of FinalEngine namespace section
Final3DFrameListener.cpp&~&23KB&&&&
Final3DFrameListener.h&~&3KB&&&&
Final3DFrameListener:
@author: 贾林林
@reference:
1. OGRE+CEGUI游戏教程(2)----NPC对话演示 - Ai - 博客频道 - CSDN_NET, .
2. OGRE+CEGUI游戏教程(3)----角色创建 - Ai - 博客频道 - CSDN_NET, .
#ifndef _FD_FINAL3DFRAMELISTENER_H_
#define _FD_FINAL3DFRAMELISTENER_H_
#include "stdafx.h"
#include "defines.h"
// Start of FinalEngine namespace section
namespace FinalEngine
class Final3DFrameListener: public ExampleFrameListener, public OIS::MouseListener,
public OIS::KeyListener, public OIS::JoyStickListener, OgreBites::SdkTrayListener
Final3DFrameListener(RenderWindow* win, Camera* cam, SceneManager* sceneMgr/*, Final3DParams strF3DParams*/);
virtual ~Final3DFrameListener();
protected:
// 开始渲染帧
bool frameStarted(const FrameEvent& evt);
/* 鼠标帧听器 */
// 移动鼠标
bool mouseMoved(const OIS::MouseEvent& MEve);
// 按下鼠标
bool mousePressed(const OIS::MouseEvent& MEve, OIS::MouseButtonID MId);
// 释放鼠标
bool mouseReleased(const OIS::MouseEvent& MEve, OIS::MouseButtonID MId);
/* 键盘帧听器 */
// 按下键盘键
bool keyPressed(const OIS::KeyEvent& KEve);
// 释放键盘键
bool keyReleased(const OIS::KeyEvent& KEve);
/* 手柄帧听器 */
// 按下手柄键
bool buttonPressed( const OIS::JoyStickEvent &JEve, int button );
// 释放手柄键
bool buttonReleased( const OIS::JoyStickEvent &JEve, int button );
// 移动坐标
bool axisMoved( const OIS::JoyStickEvent &JEve, int axis );
// 移动视点
bool povMoved(const OIS::JoyStickEvent &JEve, int pov);
protected:
// 更新3D图像
bool update3dRender(const FrameEvent& evt);
// 初始化ogre托盘
bool initOgreTray(void);
// 更新ogre托盘
bool updateOgreTray(const FrameEvent& evt);
// 启动、初始化GUI动画
void startGuiAnim(const std::string& animName, const std::string& targetWindow);
开始轨迹动画
@trackNode 动画跟踪节点
是否开始动画
动画是否循环
void startTrackAnimation(SceneNode* trackNode, bool start, bool loop = false);
// 将以秒为单位的时间转换为时、分、秒格式的字符串
Ogre::String convertTime(float sec);
// 以标准双位格式输出时间
// example: 8 → "08"
Ogre::String setTimeToStdFormat(WORD wTime);
protected:
//bool mMouseD // 上一帧鼠标左键是否按下
//Real mT // 可以执行下次操作之前的时间(到下次触发开始前所剩余的时间)
Real mR // 旋转常量
Real mM // 移动常量
SceneManager* mSceneM // 当前的场景管理器
// SceneNode* mCamN // 当前绑定到摄像机的场景节点
Vector3 mD // 移动方向
// OgreBites
OgreBites::SdkTrayManager* mTrayM
OgreBites::ParamsPanel* mDetailsP // sample details panel
OgreBites::ParamsPanel* mTimeP
//Final3DParams gF3DP // 传递参数结构
//SceneNode* mEarthN // 地球节点
bool mMouseLeftC // 鼠标是否左击
CEGUI::Animation* mGuiA // GUI动画
CEGUI::AnimationInstance* mGuiAnimI // GUI动画实例
} // End of FinalEngine namespace section
GuiSystem.cpp&~&8KB&&&&
#include "StdAfx.h"
#include "GuiSystem.h"
#include "Final3DFrameListener.h"
#include "Final3DApplication.h"
// Start of FinalEngine namespace section
namespace FinalEngine
GuiSystem* GuiSystem::ms_singleton = NULL;
GuiSystem::~GuiSystem(void)
cegui_Destroy();
bool GuiSystem::cegui_Init()
if (!mGUIRenderer)
// 初始化CEGUI渲染系统
mGUIRenderer = &CEGUI::OgreRenderer::bootstrapSystem();
mGuiSystem = &CEGUI::System::getSingleton();
// 定义logger(日志记录器)对象,有用信息将被记录(如创建对象)
CEGUI::Logger::getSingleton().setLoggingLevel(CEGUI::Informative);
//加载GUI主题, 设置默认参数
CEGUI::Imageset::setDefaultResourceGroup("Imagesets");
CEGUI::Font::setDefaultResourceGroup("Fonts");
CEGUI::Scheme::setDefaultResourceGroup("Schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("LookNFeel");
CEGUI::WindowManager::setDefaultResourceGroup("Layouts");
// 载入CEGUI scheme
// The first thing to do is load a CEGUI 'scheme'. this is basically a file
// that groups all the required resources and definitions for a particular
// skin so they can be loaded / initialised easily.
// So, we use the SchemeManager singleton to load in a scheme that loads the
// imagery and registers widgets for the TaharezLook skin.
This scheme also
// loads in a font that gets used as the system default.
CEGUI::SchemeManager::getSingleton().create("Xianjian.scheme");
// 设置字体
CEGUI::Font* font = &CEGUI::FontManager::getSingleton().create("Xianjian.font");
mGuiSystem-&setDefaultFont(font);
// 设置默认鼠标指针图形
// The TaharezLook Imageset contains an Image named "MouseArrow" which is
// the ideal thing to have as a defult mouse cursor image.
mGuiSystem-&setDefaultMouseCursor("Xianjian", "Xj4MainCur");
// 设置GUI鼠标是否可见
cegui_ShowGuiCursor(true);
// 创建窗口管理器
// All windows and widgets are created via the WindowManager singleton.
mWinMgr = CEGUI::WindowManager::getSingletonPtr();
//CEGUI::Window* sheet =
winMgr.loadWindowLayout("MyUI.layout");
//CEGUI::System::getSingleton().setGUISheet(sheet);
// 创建一个DefaultWindow。
// Here we create a "DeafultWindow".
This is a native type, that is, it does
// not have to be loaded via a scheme, it is always available.
One common use
// for the DefaultWindow is as a generic container for other windows.
// size defaults to 1.0f x 1.0f using the Relative metrics mode, which means
// when it is set as the root GUI sheet window, it will cover the entire display.
// The DefaultWindow does not perform any rendering of its own, so is invisible.
rootWindow = (CEGUI::DefaultWindow*)mWinMgr-&createWindow("DefaultWindow", "RootWindow");
// 设置GUI根窗口
// set the GUI root window (also known as the GUI "sheet"), so the gui we set up
// will be visible.
mGuiSystem-&setGUISheet(rootWindow);
// 创建一个FrameWindow。
// A FrameWindow is a window with a frame and a titlebar which may be moved around
// and resized.
CEGUI::FrameWindow* FWin = (CEGUI::FrameWindow*)mWinMgr-&createWindow("Xianjian/Editbox", "Demo Window");
// 将新窗口作为子窗口链接到默认窗口,此步骤后窗口即可显示出来
// Here we attach the newly created FrameWindow to the previously created
// DefaultWindow which we will be using as the root of the displayed gui.
rootWindow-&addChildWindow(FWin);
// 设置子窗口大小和位置(相对父窗口值)
// Windows are in Relative metrics mode by default.
This means that we can
// specify sizes and positions without having to know the exact pixel size
// of the elements in advance.
The relative metrics mode co-ordinates are
// relative to the parent of the window where the co-ordinates are being set.
// This means that if 0.5f is specified as the width for a window, that window
// will be half as its parent window.
FWin-&setPosition(CEGUI::UVector2(cegui_reldim(0.0f), cegui_reldim(0.0f)));
//FWin-&setSize(CEGUI::UVector2(cegui_reldim(0.25f), cegui_reldim(0.5f)));
// 设置子窗口最大、最小尺寸(相对显示屏幕值)
// now we set the maximum and minum sizes for the new window.
// specified using relative co-ordinates, but the important thing to note
// is that these settings are aways relative to the display rather than the
// parent window.
FWin-&setMaxSize(CEGUI::UVector2(cegui_reldim(1.0f), cegui_reldim(1.0f)));
FWin-&setMinSize(CEGUI::UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));
// 设置子窗口标题
// As a final step in the initialisation of our sample window, we set the window's
// text, so that this text will appear as the caption in the FrameWindow's titlebar.
FWin-&setText((CEGUI::utf8*)Ogre::UTFString(L"林林的图形用户界面Linlin's Gui Window. (don't know how to afford chinese character)").asUTF8_c_str()); // 贾林林的GUI窗口
cegui_CreateQuitBtn();
void GuiSystem::cegui_Update(float timeSinceLastFrame)
mGuiSystem-&injectTimePulse(timeSinceLastFrame);
void GuiSystem::cegui_CreateImageset(const std::string& name, const std::string& filename)
CEGUI::ImagesetManager::getSingleton().createFromImageFile(name, filename);
bool GuiSystem::cegui_LoadLayout(const std::string& layoutName, bool ifShow /* = true */)
CEGUI::Window* guiS
// 检测给定layout的文件是否加载,没有则加载
if (!cegui_GetGuiWindowMgr()-&isWindowPresent("Root_" + layoutName))
// 从.layout脚本文件读取一个UI布局设计,并将其放置到GUI资源组中
guiSheet = cegui_GetGuiWindowMgr()-&loadWindowLayout(layoutName + ".layout");
// 如果已经加载则直接显示
guiSheet = cegui_GetGuiWindowMgr()-&getWindow("Root_" + layoutName);
// 通知CEGUI显示哪份UI布局。此显示的UI布局可随时更换。
mGuiSystem-&setGUISheet(guiSheet);
// 显示UI布局
if (ifShow == true)
guiSheet-&show();
guiSheet-&hide();
CEGUI::MouseButton GuiSystem::cegui_ConvertButton(OIS::MouseButtonID buttonId)
switch (buttonId)
case OIS::MB_Left:
return CEGUI::LeftB
case OIS::MB_Right:
return CEGUI::RightB
case OIS::MB_Middle:
return CEGUI::MiddleB
return CEGUI::LeftB
void GuiSystem::cegui_SubscribeEvent(const CEGUI::String& windowName,
const CEGUI::String& eventName,
const CEGUI::Event::Subscriber& subscriber)
CEGUI::WindowManager::getSingleton().getWindow(CEGUI::String(windowName))
//mWinMgr-&createWindow("Xianjian/Button", (CEGUI::utf8*)"Quit");
//mWinMgr-&getWindow(CEGUI::String(windowName))
-&subscribeEvent(eventName, subscriber);
void GuiSystem::cegui_SetProperty(const std::string& windowName,
const std::string& key, const std::string& value)
GuiSystem::getSingletonPtr()-&cegui_GetWindow(windowName)-&setProperty(key, value);
const CEGUI::String& GuiSystem::cegui_showChinese(const Ogre::String& strChinese)
return (CEGUI::utf8*)Ogre::UTFString(L"林林的图形用户界面Linlin's Gui Window. (don't know how to afford chinese character)").asUTF8_c_str();
bool GuiSystem::cegui_CreateQuitBtn(void)
// 创建按钮
CEGUI::PushButton* quitButton = (CEGUI::PushButton*)mWinMgr-&createWindow("Xianjian/Button", (CEGUI::utf8*)"Quit");
rootWindow-&addChildWindow(quitButton);
quitButton-&setPosition(CEGUI::UVector2(cegui_reldim(0.15f), cegui_reldim(0.15f)));
quitButton-&setSize(CEGUI::UVector2(cegui_reldim(0.05f), cegui_reldim(0.05f)));
quitButton-&setText("Quit");
//cegui_SubscribeEvent((CEGUI::utf8*)"Quit", CEGUI::PushButton::EventClicked,
//CEGUI::Event::Subscriber(&Final3DFrameListener::handleQuit, this));
// 注册事件处理器
//quitButton-&subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&Final3DFrameListener::handleQuit, this));
bool GuiSystem::cegui_DestroyWindow(const std::string& windowName)
cegui_GetGuiWindowMgr()-&destroyWindow(windowName);
bool GuiSystem::cegui_Destroy()
//if (mGuiSystem && mGUIRenderer)
// CEGUI::OgreRenderer::destroySystem();
delete ms_
ms_singleton = 0;
} // End of FinalEngine namespace section
GuiSystem.h&~&4KB&&&&
Gui System:
@author: 贾林林
@reference:
1. OGRE+CEGUI游戏教程(1)----GUI框架 - Ai - 博客频道 - CSDN_NET, .
#ifndef _FD_GUISYSTEM_H_
#define _FD_GUISYSTEM_H_
// Start of FinalEngine namespace section
namespace FinalEngine
class GuiSystem
//GuiSystem(void);
virtual ~GuiSystem(void);
// 初始化CEGUI, 必须在RenderWindow创始后初始, 只在第一次调用有效
bool cegui_Init();
// GUI更新
void cegui_Update(float timeSinceLastFrame);
// 把OIS的鼠标ID转换成CEGUI的鼠标ID
static CEGUI::MouseButton cegui_ConvertButton(OIS::MouseButtonID buttonId);
// 销毁资源
bool cegui_Destroy();
根据图片构造Imageset
创建的Imageset名称,全局唯一
@filename 创建Imageset的图片名称
static void cegui_CreateImageset(const std::string& name, const std::string& filename);
// 加载layout
bool cegui_LoadLayout(const std::string& layoutName, bool ifShow = true);
卸载layout,即销毁layout的根窗口
@layoutName 要卸载的layout
layout卸载成功
layout已被卸载
// BOOL cegui_UnloadLayout(const std::string& layoutName);
// 得到指定名称的窗口
inline CEGUI::Window* cegui_GetWindow(const std::string& windowName)
return cegui_GetGuiWindowMgr()-&getWindow(windowName);
// 销毁指定名称的窗口
bool cegui_DestroyWindow(const std::string& windowName);
给指定名称的窗口设定属性
@windowName
static void cegui_SetProperty(const std::string& windowName, const std::string& key,
const std::string& value);
注册CEGUI控件事件
@windowName
要注册事件的控件名称
@eventName
注册的控件事件
@subscriber
事件触发时的回调函数
static void cegui_SubscribeEvent(const CEGUI::String& windowName,
const CEGUI::String& eventName,
const CEGUI::Event::Subscriber& subscriber);
// 得到system
inline CEGUI::System* cegui_GetSystem()
return mGuiS
// 得到窗口管理器,用来获取管理GUI的窗口对象的管理器
inline CEGUI::WindowManager* cegui_GetGuiWindowMgr()
return mWinMgr-&getSingletonPtr();
// 注入CEGUI鼠标点击事件
bool cegui_InjectMouseBtnDwn(CEGUI::MouseButton id)
return mGuiSystem-&injectMouseButtonDown(id);
bool cegui_InjectMouseBtnUp(CEGUI::MouseButton id)
return mGuiSystem-&injectMouseButtonUp(id);
// 注入CEGUI鼠标移动事件
bool cegui_InjectMouseMove(float xRel, float yRel)
return mGuiSystem-&injectMouseMove(xRel, yRel);
// 显示/隐藏GUI鼠标
inline void cegui_ShowGuiCursor(bool showCursor)
if (showCursor)
CEGUI::MouseCursor::getSingleton().show();
CEGUI::MouseCursor::getSingleton().hide();
// 隐藏系统鼠标
ShowCursor(false);
设置默认鼠标样式
@schemeName
@mouseName
样式中的鼠标名称
inline void cegui_SetDefaultMouseCursor(const std::string& schemeName, const std::string& mouseName)
CEGUI::System::getSingleton().setDefaultMouseCursor(schemeName, mouseName);
CEGUI::MouseCursor::getSingleton().setImage(mGuiSystem-&getDefaultMouseCursor());
// 输出中文字符
const CEGUI::String& cegui_showChinese(const Ogre::String& strChinese);
bool cegui_CreateQuitBtn(void); // 创建退出按钮
单件实例方法
static GuiSystem* getSingletonPtr()
if (ms_singleton == NULL)
ms_singleton = new GuiS
return ms_
// 单件实例指针
static GuiSystem* ms_
私有化实例函数,实现单件
GuiSystem()
:mGUIRenderer(0), mGuiSystem(0)
GuiSystem(const GuiSystem&);
GuiSystem& operator=(const GuiSystem&);
CEGUI::OgreRenderer* mGUIR // Cegui渲染环境
CEGUI::System* mGuiS // 渲染系统
CEGUI::WindowManager* mWinM // 窗口管理器
CEGUI::DefaultWindow* rootW // 根窗口,不显示
} // End of FinalEngine namespace section
main.cpp&~&898B&&&&
#include "main.h"
#include "defines.h"
// 判断编译平台
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
// Win32平台
INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
// 非Win32平台
int main(int argc, char** argv)
// Create application object.
SolarSystemA
// 系统启动时间
gTimeDef.startTime = GetTickCount() * 0.001f;
// 执行go函数,开始应用程序过程
// 异常处理
catch (Exception& e)
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
// Win32平台异常提示
MessageBox(NULL, e.getFullDescription().c_str(), "An exception has occured!",
MB_OK | MB_ICONERROR | MB_TASKMODAL);
// 非Win32平台异常提示
//std::cerr&& "An exception has occured:"&&e.getFullDescription();
fprintf(stderr, "An exception has occured: %s\n", e.getFullDescription().c_str());
10.&[文件]
main.h&~&110B&&&&
#ifndef _FD_MAIN_H_
#define _FD_MAIN_H_
#include "stdafx.h"
#include "SolarSystemApplication.h"
11.&[文件]
SolarSystemApplication.cpp&~&39KB&&&&
12.&[文件]
SolarSystemApplication.h&~&3KB&&&&
Soalr System Application:
@author: 贾林林
@reference:
1. OGRE+CEGUI游戏教程(2)----NPC对话演示 - Ai - 博客频道 - CSDN_NET, .
2. OGRE+CEGUI游戏教程(3)----角色创建 - Ai - 博客频道 - CSDN_NET, .
#ifndef _FD_SOLARSYSTEMAPPLICATION_H_
#define _FD_SOLARSYSTEMAPPLICATION_H_
#include "final3dapplication.h"
#include "stdafx.h"
#include "defines.h"
#include "SoundSystem.h"
#include "Final3DFrameListener.h"
using namespace O
using namespace FinalE
class SolarSystemApplication :
public Final3DApplication
enum CharaType
SolarSystemApplication(void)
// 初始化轨迹动画和UI参数
gF3DParams.mStartTrack =
gF3DParams.mExitUI =
// 初始创建角色GUI的参数
gF3DParams.mCharaAnimState = NULL;
gF3DParams.mBackupCharaAnimState = NULL;
virtual ~SolarSystemApplication(void) {}
protected:
void gameProgress(void);
// 设置游戏开始时的GUI
void setupStartGui(void);
// 设置主选单
void setupMainMenu(void);
// 主选单中可重复调用的内容
void initMainMenu(void);
// 设置创建角色界面
void setupCharaGui();
// 从GUI创建角色
void createChara(CharaType charaType);
// 设置开始游戏后的UI
void setupGamingUI(void);
// 初始化3D场景
void init3dScene(void);
// 创建轨迹动画
void createTrackAnimation();
// 创建粒子系统
virtual void createParticle();
// 主菜单,鼠标移动到按钮时响应
bool mainMenuBtnHover(const CEGUI::EventArgs& e);
// 主菜单,鼠标移出按钮时响应
bool mainMenuBtnBack(const CEGUI::EventArgs& e);
// 主菜单,点击按钮时响应
bool mainMenuBtnDwn(const CEGUI::EventArgs& e);
// 退出窗口,退出游戏响应
bool QuitGame(const CEGUI::EventArgs& e);
// 退出窗口,取消退出游戏响应
bool CancelQuit(const CEGUI::EventArgs& e);
// 未完成提示窗口,返回
bool CancelReady(const CEGUI::EventArgs& e);
// 未完成提示窗口,点击取消按钮时的警告响应
bool NotReadyWarn(const CEGUI::EventArgs& e);
// 未完成提示窗口,结束警告响应
bool StopWarn(const CEGUI::EventArgs& e);
// 创建角色事件响应
bool charaSelectedHandler(const CEGUI::EventArgs& e);
// 创建角色界面,当输入框中的文本变化时触发的事件
bool inputAcceptedHandler(const CEGUI::EventArgs& e);
// 创建角色界面,开始按钮事件响应
bool startHandler(const CEGUI::EventArgs& e);
// 创建角色界面,返回主界面按钮事件响应
bool backToMain(const CEGUI::EventArgs& e);
// 创建角色界面,鼠标移入模型区事件响应
bool enterCharaArea(const CEGUI::EventArgs& e);
// 创建角色界面,鼠标移出模型区事件响应
bool leaveCharaArea(const CEGUI::EventArgs& e);
// 游戏UI,退出UI,返回游戏事件响应
bool backGaming(const CEGUI::EventArgs& e);
// 退出按钮事件响应
// bool quit(const CEGUI::EventArgs& e);
// 点击NPC事件响应
// bool know(const CEGUI::EventArgs& e);
protected:
bool isMainC // 主界面是否已创建
bool isCharaWinC // 角色创建界面是否已创建
Ogre::String mCharaN // 角色名字
Ogre::Entity* mCharaEntA; // 角色A实体
Ogre::Entity* mCharaEntB; // 角色B实体
Ogre::Entity* mCharaEntC; // 角色C实体
CharaType mCharaT // 保存选择的角色类型
bool isCharaR // 角色模型是否可以旋转
//SceneNode* mEarthN // 地球节点
//CEGUI::OgreRenderer* mGUIR
//CEGUI::Window* mEditorGuiS
13.&[文件]
SoundSystem.cpp&~&6KB&&&&
#include "SoundSystem.h"
// Start of FinalEngine namespace section
namespace FinalEngine
void ERRCHECK(FMOD_RESULT result);
void ERRCHECK1(FMOD_RESULT result)
if (result != FMOD_OK)
MessageBox( NULL, FMOD_ErrorString(result), "FMOD: An exception has occured11!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
bool SoundSystem::fmod_Init()
Create a System object and initialize.
result = FMOD::System_Create(&system); // 创建FMOD系统
ERRCHECK(result);
result = system-&getVersion(&version); // 获取系统版本号
ERRCHECK(result);
if (version & FMOD_VERSION) // 版本不够
printf("Error! You are using an old version of FMOD %08x. This program requires %08x.\nPS: FMOD is the sound system.",
version, FMOD_VERSION);
result = system-&getNumDrivers(&numdrivers);
ERRCHECK(result);
if (numdrivers == 0)
result = system-&setOutput(FMOD_OUTPUTTYPE_NOSOUND);
ERRCHECK(result);
result = system-&getDriverCaps(0, &caps, 0, &speakerMode);
ERRCHECK(result);
Set the user selected speaker mode.
result = system-&setSpeakerMode(speakerMode);
ERRCHECK(result);
if (caps & FMOD_CAPS_HARDWARE_EMULATED)
The user has the 'Acceleration' slider set to off! This is really bad
for latency! You might want to warn the user about this.
result = system-&setDSPBufferSize(1024, 10);
ERRCHECK(result);
result = system-&getDriverInfo(0, name, 256, 0);
ERRCHECK(result);
if (strstr(name, "SigmaTel"))
Sigmatel sound devices crackle for some reason if the format is PCM 16bit.
PCM floating point output seems to solve it.
result = system-&setSoftwareFormat(48000, FMOD_SOUND_FORMAT_PCMFLOAT, 0, 0, FMOD_DSP_RESAMPLER_LINEAR);
ERRCHECK(result);
// 初始化系统
result = system-&init(100, FMOD_INIT_NORMAL, 0);
if (result == FMOD_ERR_OUTPUT_CREATEBUFFER)
Ok, the speaker mode selected isn't supported by this soundcard. Switch it
back to stereo...
= system-&setSpeakerMode(FMOD_SPEAKERMODE_STEREO);
ERRCHECK(result);
... and re-init.
result = system-&init(100, FMOD_INIT_NORMAL, 0);
ERRCHECK(result);
// 创建声音,载入歌曲
result = system-&createSound("../media/sounds/He's a Pirate.mp3",
FMOD_LOOP_NORMAL, 0, &sound[0]); // 宇宙空间航行配乐
ERRCHECK(result);
result = system-&createSound("../media/sounds/Going Home.mp3",
FMOD_LOOP_NORMAL, 0, &sound[1]); // 地球配乐
ERRCHECK(result);
result = system-&createSound("../media/sounds/Fly Me To The Moon.mp3",
FMOD_LOOP_NORMAL, 0, &sound[2]); // 月亮配乐
ERRCHECK(result);
result = system-&createSound("../media/sounds/I See The Light.mp3",
FMOD_LOOP_NORMAL, 0, &sound[3]); // 太阳配乐
ERRCHECK(result);
result = system-&createSound("../media/sounds/A Thousand Years.mp3",
FMOD_LOOP_NORMAL, 0, &sound[4]); // 火星配乐
ERRCHECK(result);
result = system-&createSound("../media/sounds/far away from home.mp3",
FMOD_LOOP_NORMAL, 0, &sound[5]); // 地球配乐2(候选)
ERRCHECK(result);
result = system-&createSound("../media/sounds/Never Grow Old.mp3",
FMOD_LOOP_NORMAL, 0, &sound[6]); //
ERRCHECK(result);
// 创建通道组
result = system-&createChannelGroup("Group A", &groupA);
ERRCHECK(result);
result = system-&createChannelGroup("Group B", &groupB);
ERRCHECK(result);
result = system-&getMasterChannelGroup(&masterGroup); // 主通道
ERRCHECK(result);
Instead of being independent, set the group A and B to be children of the master group.
result = masterGroup-&addGroup(groupA);
ERRCHECK(result);
result = masterGroup-&addGroup(groupB);
ERRCHECK(result);
// 初始化音乐开始标志
for (int i = 0; i & soundN i ++)
ifStart[i] =
开始播放所有歌曲
for (count = 0; count & soundN count ++)
result = system-&playSound(FMOD_CHANNEL_FREE, sound[count], TRUE, &channel[count]);
ERRCHECK(result);
if (count & 3)
result = channel[count]-&setChannelGroup(groupA);
result = channel[count]-&setChannelGroup(groupB);
ERRCHECK(result);
result = channel[count]-&setPaused(false);
ERRCHECK(result);
Change the volume of each group, just because we can!
(And makes it less of a loud noise).
改变各音轨组的音量。
//result = groupA-&setVolume(0.5f);
//ERRCHECK(result);
//result = groupB-&setVolume(0.5f);
//ERRCHECK(result);
bool SoundSystem::fmod_CreateSound(const char *name_or_data, FMOD_MODE mode, int num)
result = system-&createSound(name_or_data, mode, 0, &sound[num]);
ifStart[num] =
bool SoundSystem::fmod_PlaySound(int num /* = 0 */, bool isfinite /* = true */, int loopCount /* = 0 */)
if (ifStart[num] == false)
result = system-&playSound(FMOD_CHANNEL_FREE, sound[num], FALSE, &channel[num]);
ERRCHECK(result);
if (isfinite == true)
result = channel[num]-&setLoopCount(loopCount);
ERRCHECK(result);
ifStart[num] =
for (int i = 0; i & soundN i ++)
if (ifStart[i] == true)
result = channel[i]-&stop();
ifStart[i] =
//if (num & 3)
//result = channel[num]-&setChannelGroup(groupA);
// result = channel[num]-&setChannelGroup(groupB);
//ERRCHECK(result);
bool SoundSystem::fmod_StopSound(int num)
result = channel[num]-&stop();
ERRCHECK(result);
bool SoundSystem::fmod_PauseSound(int num)
result = channel[num]-&setPaused(true);
ERRCHECK(result);
bool SoundSystem::fmod_GoOnSound(int num)
result = channel[num]-&setPaused(false);
ERRCHECK(result);
void ERRCHECK(FMOD_RESULT result)
if (result != FMOD_OK)
MessageBox( NULL, FMOD_ErrorString(result), "FMOD: An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
} // End of FinalEngine namespace section
14.&[文件]
SoundSystem.h&~&1KB&&&&
Sound System:
@author: 贾林林
#ifndef _FD_SOUNDSYSTEM_H_
#define _FD_SOUNDSYSTEM_H_
#include "stdafx.h"
//#include "defines.h"
// Start of FinalEngine namespace section
namespace FinalEngine
class SoundSystem
SoundSystem() {}
~SoundSystem() {}
bool fmod_Init();
inline FMOD::System* fmod_GetSystem() { }
bool fmod_CreateSound(const char *name_or_data, FMOD_MODE mode, int num);
bool fmod_PlaySound(int num = 0, bool isfinite = true, int loopCount = 0);
bool fmod_StopSound(int num);
bool fmod_PauseSound(int num);
bool fmod_GoOnSound(int num);
protected:
#define soundNum 10
FMOD::System*
FMOD_RESULT
FMOD_SPEAKERMODE speakerM
char name[256];
FMOD::Sound* sound[soundNum];
FMOD::Channel* channel[soundNum];
FMOD::ChannelGroup* groupA, * groupB, *masterG
bool ifStart[soundNum]; // flag是判断声音是否已经开始的标志
} // End of FinalEngine namespace section
15.&[文件]
stdafx.cpp&~&292B&&&&
// stdafx.cpp : source file that includes just the standard includes
// mySun.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
16.&[文件]
stdafx.h&~&3KB&&&&
#ifndef _FD_STDAFX_H_
#define _FD_STDAFX_H_
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//#pragma once
#define WIN32_LEAN_AND_MEAN
// Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include &windows.h&
// C RunTime Header Files
#include &stdlib.h&
#include &malloc.h&
#include &memory.h&
#include &tchar.h&
// TODO: reference additional headers your program requires here
#include &stdio.h&
#include &string.h&
#include &math.h&
// OGRE headers needed.
#include &Ogre.h&
#include &OgreException.h&
#include &OgreRoot.h&
#include &OgreConfigFile.h&
#include &OgreCamera.h&
#include &OgreViewport.h&
#include &OgreSceneManager.h&
#include &OgreRenderWindow.h&
#include &OgreEntity.h&
#include &OgreWindowEventUtilities.h&
#include &OgreLogManager.h&
#include &ExampleApplication.h&
#include &ExampleFrameListener.h&
// Output/Input system.
#include &OIS.h&
#include &OISEvents.h&
#include &OISInputManager.h&
#include &OISKeyboard.h&
#include &OISMouse.h&
#include &OISJoyStick.h&
#include &SdkTrays.h&
#include &SdkCameraMan.h&
// CEGUI Hearder needed.
#include &CEGUI.h&
#include &RendererModules/Ogre/CEGUIOgreRenderer.h&
#include &elements/CEGUIPushButton.h&
//#include &CEGuiSample.h&
// #include &CEGUIImageset.h&
// #include &CEGUISystem.h&
// #include &CEGUILogger.h&
// #include &CEGUISchemeManager.h&
// #include &CEGUIWindowManager.h&
// #include &CEGUIWindow.h&
// #include &elements/CEGUIGUISheet.h&
// #include &RendererModules/Ogre/CEGUIOgreResourceProvider.h&
// #include &RendererModules/Ogre/CEGUIOgreGeometryBuffer.h&
// 链接.lib到工程
#ifdef _DEBUG
#pragma comment(lib, "OgreMain_d.lib")
#pragma comment(lib, "OIS_d.lib")
#pragma comment(lib, "fmodex_vc.lib")
#pragma comment(lib, "CEGUIBase_d.lib")
#pragma comment(lib, "CEGUIOgreRenderer_d.lib")
//#pragma comment(lib, "CEGUISampleHelper_d.lib");
#pragma comment(lib, "OgreMain.lib")
#pragma comment(lib, "OIS.lib")
#pragma comment(lib, "fmodex_vc.lib")
#pragma comment(lib, "CEGUIBase.lib")
#pragma comment(lib, "CEGUIOgreRenderer.lib")
//#pragma comment(lib, "CEGUISampleHelper.lib");
#endif // _DEBUG
// Any other header can be included, as usual.
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
//#include "mmsystem.h" // 导入声音头文件
//#pragma comment(lib,"winmm.lib") // 导入声音头文件库
// Supporting headers of FMOD(音效)
#include &fmod.h&
#include &fmod.hpp&
#include &fmod_codec.h&
#include &fmod_dsp.h&
#include &fmod_output.h&
#include &fmod_memoryinfo.h&
#include &fmod_errors.h&
//#include "SoundManager.h"
17.&[文件]
readme.txt&~&964B&&&&
ogre支持的cegui。
这是release版本(debug的dll太大了),有些调试功能没有开启,开场logo也不能跳过。
创建角色界面按鼠标右键拖动可以旋转模型。
角色介绍界面按ESC键可以跳过。
进入游戏后,按键如下:
按键说明:
K:显示、隐藏时间板、帧信息板、摄像器信息板和ogre标志
F:打开、关闭高级帧信息,初始为关闭
G:循环打开摄像机信息板和时间板,初始为时间板
H:打开、关闭帧信息板,初始为打开
R:循环设置多边形渲染模式:Solid,Wireframe,Points,初始为Solid
T:循环设置纹理滤波平滑模式:Bilinear,Trilinear,Anisotropic,None,初始为Bilinear
L:打开、关闭ogre标志,初始为打开
Esc:退出游戏
1:移动到地球位置(有bug)
2:移动到太阳位置(有bug)
3:移动到太阳系观测点(有bug)
W/↑:向前移动
S/↓:向后移动
A/←:向左移动
D/→:向右移动
Q:向上移动
E:向下移动
PgUp:加快移动速度(有bug,不可持续按)
PgDn:减小移动速度(有bug,不可持续按)
End:切换移动速度,可在近地速度(较慢)和行星航行速度(较快)间切换,初始为近地速度(有bug,不可持续按)
主界面按好多次空格键有彩蛋哦!
18.&[文件]
使用VS2008工程时的设置.txt&~&2KB&&&&
(注意选All Configuration)
1.项目(Project)-&属性(Property)-&链接器(Linker)-&常规(General) 下面的“启用增量链接(Enable Incremental Linking)”,将“是(/INCREMENTAL)”改为“否(/INCREMENTAL:NO)”。不过这又引入了另外一个警 告:FormatCom.obj : warning LNK4075: 忽略“/EDITANDCONTINUE”(由于“/INCREMENTAL:NO”规范)选择项目,属性(Property pages)-&配置属性(Configuration Properties) -&C/C++,修改“调试信息格式(Debug Information Format)”为“程序数据库(Program Database(/Zi))”即可。
(解决如下错误:LINK : fatal error LNK1000: Internal error during IncrBuildImage)
2.选择”项目”菜单–&最后的”属性”-&”配置属性”-&”常规”-&”项目默认值”-&将字符集改为改为”未设置”或“使用多字符字节集”(默认设置为:使用 Unicode 字符集)。
(解决如下错误:error C2664: “MessageBoxW”: 不能将参数 2 从“const char [19]”转换)
3.选择”项目”菜单–&最后的”属性”-&”配置属性”-&“Debugging”,设置“Working Directory”为“D:\OGRE\OgreSDK_vc9_v1-7-4\bin\Debug”,如果使用CEGUI则设置为CEGUI的bin目录。
(解决库文件和资源文件的配置问题,或者可以把需要的文件都拷贝到工程下,并设置好Resource.cfg文件)
4.设置工程预编译头:1)选择”项目”菜单–&最后的”属性”-&”配置属性”-&“C/C++”-&“Precomiled Header”,设置“Create/Use Precompiled Header”为“Use Precompiled Header (/Yu)”,“Create/Use PCH Through File”为“Stdafx.h”。2)设置Stdafx.cpp的“Create/Use Precompiled Header”为“Create Precompiled Header (/Yc)”。3)选择”项目”菜单–&最后的”属性”-&”配置属性”-&“C/C++”-&“Advanced”,设置“Force Includes”为“Stdafx.h”(否则每个.cpp文件中都要包含该头文件)。
5.选择”项目”菜单–&最后的”属性”-&”配置属性”-&“C/C++”-&“Command Line”,添加“-Zm200”。
(貌似是扩大栈的大小)
6.包含头文件、lib等。
7.添加ogre、OIS、CEGUI、FMOD的依赖文件:选择”项目”菜单–&最后的”属性”-&”配置属性”-&“Linker”-&“Input”,在“Additional Dependencies”中添加以下几项:1)OgreMain_d.lib,2)OIS_d.lib,3)fmodex_vc.lib,4)CEGUIBase_d.lib,5)CEGUIOgreRenderer_d.lib。
或者在程序中用语句#prama comment(lib, "XXX.lib")分别添加以上库。
(最好从空文件自己从头创建,VS2008Bug极多。)
19.&[图片] main.jpg&&&&
20.&[图片] char.jpg&&&&
21.&[图片] loading.jpg&&&&
22.&[图片] quit.jpg&&&&
开源中国-程序员在线工具:
相关的代码(159)
0回/12066阅
1回/7196阅
2回/2945阅
0回/1057阅
0回/7143阅
0回/2063阅
1回/3185阅
0回/3076阅
开源从代码分享开始
Jalin的其它代码

我要回帖

更多关于 做餐饮的微信辞职一个月还不批 的文章

 

随机推荐