我要发帖 回复

中级会员

4

主题

100

积分

0

专家分

兴趣点(最多三项):

建模技术

私信
发表时间 : 2014-12-25 11:19:50 | 浏览 : 1395    评论 : 10
本帖最后由 阿莱克 于 2014-12-26 06:18 PM 编辑

我按照王孝平的书5.2节做的例子  代码调试时没有错误 ,可是在出现对话框点击“运行”按钮时没有出图啊?
求大神解答啊?
下面PublicMember.cpp文件

  1. *#include "StdAfx.h"
  2. #include "PublicMember.h"
  3. //公共成员变量

  4. HWND PublicMember::CTS_RunningWindow=NULL;
  5. bool PublicMember::CTS_continueRunVP=NULL;
  6. CWinThread* PublicMember::CTS_vegaThread=NULL;
  7. InstancesList* PublicMember::CTS_s_pInstancesToUnref=NULL;
  8. vpSearchPath* PublicMember::CTS_pSearchPath_mySearchPath=NULL;
  9. vpScene* PublicMember::CTS_pScene_myScene=NULL;


  10. //公共成员函数

  11. PublicMember::PublicMember(void)
  12. {
  13. }

  14. PublicMember::~PublicMember(void)
  15. {
  16. }

  17. void PublicMember::CTS_Define( void )
  18. {
  19. // Create static instances list that we use to track what we create
  20. PublicMember::CTS_s_pInstancesToUnref = new InstancesList;

  21. //
  22. // Initialize all modules
  23. //

  24. vpModule::initializeModule( "vpEnv" );
  25. vpModule::initializeModule( "vpMotion" );
  26. vpModule::initializeModule( "vpFx" );


  27. //
  28. // Create all instances
  29. //

  30. vpKernel* pKernel_myKernel = vpKernel::instance();
  31. pKernel_myKernel->setNotifyLevel( vuNotify::LEVEL_WARN );
  32. pKernel_myKernel->setNotifyColorEnable( false );
  33. pKernel_myKernel->setPriority( vuThread::PRIORITY_NORMAL );
  34. pKernel_myKernel->setProcessor( -1 );
  35. pKernel_myKernel->setFrameRateLimiterEnable( true );
  36. pKernel_myKernel->setDesiredFrameRate( 0 );
  37. pKernel_myKernel->setNotifyClassTypeMode( vuNotify::CLASS_TYPE_MODE_INCLUSIVE );

  38. PublicMember::CTS_pSearchPath_mySearchPath = vpSearchPath::instance();
  39. PublicMember::CTS_pSearchPath_mySearchPath->append( "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$(MPI_INSTALL_RESOURCE_DEFAULT)/resources/data/databases/camp_pendleton/" );
  40. PublicMember::CTS_pSearchPath_mySearchPath->append( "C:/Presagis/tutorials/Exercise_Files" );
  41. PublicMember::CTS_pSearchPath_mySearchPath->append( "C:/Presagis/tutorials/DesktopTutor/Models" );
  42. PublicMember::CTS_pSearchPath_mySearchPath->append( "C:/Presagis/tutorials/DesktopTutor/Batch_Tutorial/Models" );

  43. vpPipeline* pPipeline_myPipeline = new vpPipeline();
  44. pPipeline_myPipeline->setName( "myPipeline" );
  45. pPipeline_myPipeline->setMultiThread( vsPipeline::MULTITHREAD_INLINE );
  46. pPipeline_myPipeline->setId( 0 );
  47. pPipeline_myPipeline->setNumCullThreads( 0 );
  48. pPipeline_myPipeline->setCullThreadPriority( vuThread::PRIORITY_NORMAL );
  49. pPipeline_myPipeline->setCullThreadProcessor( -1 );
  50. pPipeline_myPipeline->setDrawThreadPriority( vuThread::PRIORITY_NORMAL );
  51. pPipeline_myPipeline->setDrawThreadProcessor( -1 );
  52. pPipeline_myPipeline->setBeginFrameOnVsyncEnable( false );
  53. pPipeline_myPipeline->setDesiredPostDrawTime( -1 );
  54. pPipeline_myPipeline->setTextureSubloadOnPreDrawEnable( false );
  55. pPipeline_myPipeline->setDesiredTextureSubloadOnPreDrawTime( -1 );

  56. PublicMember::CTS_s_pInstancesToUnref->push_back( pPipeline_myPipeline );

  57. vpWindow* pWindow_myWindow = new vpWindow();
  58. pWindow_myWindow->setName( "myWindow" );
  59. pWindow_myWindow->setLabel( "Vega Prime Window" );
  60. pWindow_myWindow->setOrigin( 0 , 0 );
  61. pWindow_myWindow->setSize( 1024 , 768 );
  62. pWindow_myWindow->setFullScreenEnable( false );
  63. pWindow_myWindow->setBorderEnable( true );
  64. pWindow_myWindow->setInputEnable( true );
  65. pWindow_myWindow->setCursorEnable( true );
  66. pWindow_myWindow->setStereoEnable( false );
  67. pWindow_myWindow->setNumColorBits( 8 );
  68. pWindow_myWindow->setNumAlphaBits( 8 );
  69. pWindow_myWindow->setNumDepthBits( 24 );
  70. pWindow_myWindow->setNumStencilBits( 0 );
  71. pWindow_myWindow->setNumAccumColorBits( 0 );
  72. pWindow_myWindow->setNumAccumAlphaBits( 0 );
  73. pWindow_myWindow->setNumMultiSampleBits( 4 );
  74. pWindow_myWindow->setSwapInterval( 1 );
  75. pWindow_myWindow->setPixelBufferMode( vrDrawContext::PIXEL_BUFFER_MODE_OFF );

  76. PublicMember::CTS_s_pInstancesToUnref->push_back( pWindow_myWindow );

  77. vpChannel* pChannel_myChannel = new vpChannel();
  78. pChannel_myChannel->setName( "myChannel" );
  79. pChannel_myChannel->setOffsetTranslate( 0 , 0 , 0 );
  80. pChannel_myChannel->setOffsetRotate( 0 , 0 , 0 );
  81. pChannel_myChannel->setCullMask( 0x0FFFFFFFF );
  82. pChannel_myChannel->setRenderMask( 0x0FFFFFFFF );
  83. pChannel_myChannel->setClearColor( 0.000000f , 0.500000f , 1.000000f , 0.000000f );
  84. pChannel_myChannel->setClearBuffers( 0x03 );
  85. pChannel_myChannel->setDrawArea( 0 , 1 , 0 , 1 );
  86. pChannel_myChannel->setFOVSymmetric( 45.000000f , -1.000000f );
  87. pChannel_myChannel->setNearFar( 1.000000f , 35000.000000f );
  88. pChannel_myChannel->setLODVisibilityRangeScale( 1 );
  89. pChannel_myChannel->setLODTransitionRangeScale( 1 );
  90. pChannel_myChannel->setFOVScale( -1 );
  91. pChannel_myChannel->setCullThreadPriority( vuThread::PRIORITY_NORMAL );
  92. pChannel_myChannel->setCullThreadProcessor( -1 );
  93. pChannel_myChannel->setGraphicsModeEnable( vpChannel::GRAPHICS_MODE_WIREFRAME , false );
  94. pChannel_myChannel->setGraphicsModeEnable( vpChannel::GRAPHICS_MODE_TRANSPARENCY , true );
  95. pChannel_myChannel->setGraphicsModeEnable( vpChannel::GRAPHICS_MODE_TEXTURE , true );
  96. pChannel_myChannel->setGraphicsModeEnable( vpChannel::GRAPHICS_MODE_LIGHT , true );
  97. pChannel_myChannel->setGraphicsModeEnable( vpChannel::GRAPHICS_MODE_FOG , true );
  98. pChannel_myChannel->setGraphicsModeEnable( vpChannel::GRAPHICS_MODE_SHADERS , true );
  99. pChannel_myChannel->setLightPointThreadPriority( vuThread::PRIORITY_NORMAL );
  100. pChannel_myChannel->setLightPointThreadProcessor( -1 );
  101. pChannel_myChannel->setMultiSample( vpChannel::MULTISAMPLE_ANTIALIAS );
  102. pChannel_myChannel->setStatisticsPage( vpChannel::PAGE_OFF );
  103. pChannel_myChannel->setCullBoundingBoxTestEnable( false );
  104. pChannel_myChannel->setOpaqueSort( vpChannel::OPAQUE_SORT_TEXTURE , vpChannel::OPAQUE_SORT_MATERIAL );
  105. pChannel_myChannel->setTransparentSort( vpChannel::TRANSPARENT_SORT_DEPTH );
  106. pChannel_myChannel->setDrawBuffer( vpChannel::DRAW_BUFFER_DEFAULT );
  107. pChannel_myChannel->setStressEnable( false );
  108. pChannel_myChannel->setStressParameters( 1.000000f , 20.000000f , 0.750000f , 0.500000f , 2.000000f );

  109. PublicMember::CTS_s_pInstancesToUnref->push_back( pChannel_myChannel );

  110. vpChannel* pChannel_myChannel1 = new vpChannel();
  111. pChannel_myChannel1->setName( "myChannel1" );
  112. pChannel_myChannel1->setOffsetTranslate( 0 , 0 , 1 );
  113. pChannel_myChannel1->setOffsetRotate( 0 , 0 , 0 );
  114. pChannel_myChannel1->setCullMask( 0x0FFFFFFFF );
  115. pChannel_myChannel1->setRenderMask( 0x0FFFFFFFF );
  116. pChannel_myChannel1->setClearColor( 0.000000f , 0.500000f , 1.000000f , 0.000000f );
  117. pChannel_myChannel1->setClearBuffers( 0x03 );
  118. pChannel_myChannel1->setDrawArea( 0 , 0.3 , 0.7 , 1 );
  119. pChannel_myChannel1->setFOVSymmetric( 45.000000f , -1.000000f );
  120. pChannel_myChannel1->setNearFar( 1.000000f , 35000.000000f );
  121. pChannel_myChannel1->setLODVisibilityRangeScale( 1 );
  122. pChannel_myChannel1->setLODTransitionRangeScale( 1 );
  123. pChannel_myChannel1->setFOVScale( -1 );
  124. pChannel_myChannel1->setCullThreadPriority( vuThread::PRIORITY_NORMAL );
  125. pChannel_myChannel1->setCullThreadProcessor( -1 );
  126. pChannel_myChannel1->setGraphicsModeEnable( vpChannel::GRAPHICS_MODE_WIREFRAME , false );
  127. pChannel_myChannel1->setGraphicsModeEnable( vpChannel::GRAPHICS_MODE_TRANSPARENCY , true );
  128. pChannel_myChannel1->setGraphicsModeEnable( vpChannel::GRAPHICS_MODE_TEXTURE , true );
  129. pChannel_myChannel1->setGraphicsModeEnable( vpChannel::GRAPHICS_MODE_LIGHT , true );
  130. pChannel_myChannel1->setGraphicsModeEnable( vpChannel::GRAPHICS_MODE_FOG , true );
  131. pChannel_myChannel1->setGraphicsModeEnable( vpChannel::GRAPHICS_MODE_SHADERS , true );
  132. pChannel_myChannel1->setLightPointThreadPriority( vuThread::PRIORITY_NORMAL );
  133. pChannel_myChannel1->setLightPointThreadProcessor( -1 );
  134. pChannel_myChannel1->setMultiSample( vpChannel::MULTISAMPLE_OFF );
  135. pChannel_myChannel1->setStatisticsPage( vpChannel::PAGE_OFF );
  136. pChannel_myChannel1->setCullBoundingBoxTestEnable( false );
  137. pChannel_myChannel1->setOpaqueSort( vpChannel::OPAQUE_SORT_TEXTURE , vpChannel::OPAQUE_SORT_MATERIAL );
  138. pChannel_myChannel1->setTransparentSort( vpChannel::TRANSPARENT_SORT_DEPTH );
  139. pChannel_myChannel1->setDrawBuffer( vpChannel::DRAW_BUFFER_DEFAULT );
  140. pChannel_myChannel1->setStressEnable( false );
  141. pChannel_myChannel1->setStressParameters( 1.000000f , 20.000000f , 0.750000f , 0.500000f , 2.000000f );

  142. PublicMember::CTS_s_pInstancesToUnref->push_back( pChannel_myChannel1 );

  143. vpObserver* pObserver_myObserver = new vpObserver();
  144. pObserver_myObserver->setName( "myObserver" );
  145. pObserver_myObserver->setStrategyEnable( false );
  146. pObserver_myObserver->setTranslate( -1297.13 , -1025.92 , 343.347 );
  147. pObserver_myObserver->setRotate( 292 , -7 , 0 );
  148. pObserver_myObserver->setLatencyCriticalEnable( false );

  149. PublicMember::CTS_s_pInstancesToUnref->push_back( pObserver_myObserver );

  150. vpObserver* pObserver_myObserver1 = new vpObserver();
  151. pObserver_myObserver1->setName( "myObserver1" );
  152. pObserver_myObserver1->setStrategyEnable( true );
  153. pObserver_myObserver1->setTranslate( 0 , 0 , 0 );
  154. pObserver_myObserver1->setRotate( 0 , 0 , 0 );
  155. pObserver_myObserver1->setLatencyCriticalEnable( false );

  156. PublicMember::CTS_s_pInstancesToUnref->push_back( pObserver_myObserver1 );

  157. PublicMember::CTS_pScene_myScene = new vpScene();
  158. PublicMember::CTS_pScene_myScene->setName( "myScene" );

  159. PublicMember::CTS_s_pInstancesToUnref->push_back( PublicMember::CTS_pScene_myScene );

  160. vpTransform* pTransform_hummarTransform = new vpTransform();
  161. pTransform_hummarTransform->setName( "hummarTransform" );
  162. pTransform_hummarTransform->setCullMask( 0x0FFFFFFFF );
  163. pTransform_hummarTransform->setRenderMask( 0x0FFFFFFFF );
  164. pTransform_hummarTransform->setIsectMask( 0x0FFFFFFFF );
  165. pTransform_hummarTransform->setStrategyEnable( true );
  166. pTransform_hummarTransform->setTranslate( 0 , -350 , 50 );
  167. pTransform_hummarTransform->setRotate( 0 , 0 , 0 );
  168. pTransform_hummarTransform->setScale( 1 , 1 , 1 );
  169. pTransform_hummarTransform->setStaticEnable( false );

  170. PublicMember::CTS_s_pInstancesToUnref->push_back( pTransform_hummarTransform );

  171. vpObject* pObject_terrain = new vpObject();
  172. pObject_terrain->setName( "terrain" );
  173. pObject_terrain->setCullMask( 0x0FFFFFFFF );
  174. pObject_terrain->setRenderMask( 0x0FFFFFFFF );
  175. pObject_terrain->setIsectMask( 0x0FFFFFFFF );
  176. pObject_terrain->setStrategyEnable( false );
  177. pObject_terrain->setTranslate( 0 , 0 , 0 );
  178. pObject_terrain->setRotate( 0 , 0 , 0 );
  179. pObject_terrain->setScale( 1 , 1 , 1 );
  180. pObject_terrain->setStaticEnable( false );
  181. pObject_terrain->setFileName( "airfield.flt" );
  182. pObject_terrain->setAutoPage( vpObject::AUTO_PAGE_SYNCHRONOUS );
  183. pObject_terrain->setManualLODChild( -1 );
  184. pObject_terrain->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_COMBINE_LIGHT_POINTS , true );
  185. pObject_terrain->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_COMBINE_LODS , true );
  186. pObject_terrain->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_IGNORE_DOF_CONSTRAINTS , false );
  187. pObject_terrain->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_EXTERNAL_REF_FLAGS , true );
  188. pObject_terrain->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_GENERIC_NAMES , false );
  189. pObject_terrain->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_GENERIC_NODES , false );
  190. pObject_terrain->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_QUADS , false );
  191. pObject_terrain->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_LIGHT_SOURCES , false );
  192. pObject_terrain->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_ALL_GEOMETRIES_LIT , false );
  193. pObject_terrain->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_USE_MATERIAL_DIFFUSE_COLOR , false );
  194. pObject_terrain->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_MONOCHROME , false );
  195. pObject_terrain->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_CREATE_ANIMATIONS , true );
  196. pObject_terrain->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_SHARE_LIGHT_POINT_CONTROLS , true );
  197. pObject_terrain->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_SHARE_LIGHT_POINT_ANIMATIONS , true );
  198. pObject_terrain->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_SHARE_LIGHT_POINT_APPEARANCES , true );
  199. pObject_terrain->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_SURFACE_ATTRIBUTES , false );
  200. pObject_terrain->setLoaderDetailMultiTextureStage( -1 );
  201. pObject_terrain->setLoaderBlendTolerance( 0.050000f );
  202. pObject_terrain->setLoaderUnits( vsNodeLoader::Data::LOADER_UNITS_METERS );
  203. pObject_terrain->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_OPTIMIZE_GEOMETRIES , true );
  204. pObject_terrain->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_COLLAPSE_BINDINGS , true );
  205. pObject_terrain->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_COLLAPSE_TRIANGLE_STRIPS , true );
  206. pObject_terrain->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_MAKE_INDEXED , false );
  207. pObject_terrain->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_TANGENT_ORTHONORMALIZATION , false );
  208. pObject_terrain->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_TANGENT_PARITY_CHECK , true );
  209. pObject_terrain->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_TANGENT_HARD_EDGE_CHECK , true );
  210. pObject_terrain->setBuilderNormalMode( vsNodeLoader::Data::BUILDER_NORMAL_MODE_PRESERVE );
  211. pObject_terrain->setBuilderTangentMode( vsNodeLoader::Data::BUILDER_TANGENT_MODE_GENERATE_PER_VERTEX_PER_PRIMITIVE_AND_ANGLE_WEIGHTED );
  212. pObject_terrain->setBuilderTangentGenerationMode( vsNodeLoader::Data::BUILDER_TANGENT_GENERATION_MODE_GENERATE_AS_NEEDED );
  213. pObject_terrain->setBuilderColorTolerance( 0.001000f );
  214. pObject_terrain->setBuilderNormalTolerance( 0.860000f );
  215. pObject_terrain->setBuilderVertexTolerance( 0.000100f );
  216. pObject_terrain->setGeometryOption( vsNodeLoader::Data::GEOMETRY_OPTION_GENERATE_DISPLAY_LISTS , false );
  217. pObject_terrain->setGeometryOption( vsNodeLoader::Data::GEOMETRY_OPTION_OVERRIDE_VSB , false );
  218. pObject_terrain->setGeometryFormat( vrGeometryBase::FORMAT_VERTEX_ARRAY , 0x0FFF );
  219. pObject_terrain->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_FLATTEN , true );
  220. pObject_terrain->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_CLEAN , true );
  221. pObject_terrain->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_MERGE_GEOMETRIES , true );
  222. pObject_terrain->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_COLLAPSE_BINDINGS , true );
  223. pObject_terrain->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_COLLAPSE_TRIANGLE_STRIPS , true );
  224. pObject_terrain->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_VALIDATE , false );
  225. pObject_terrain->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_MAKE_INDEXED , false );
  226. pObject_terrain->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_OVERRIDE_VSB , false );
  227. pObject_terrain->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_SCRUB , false );
  228. pObject_terrain->setTextureSubloadEnable( false );
  229. pObject_terrain->setTextureSubloadRender( vpGeometry::TEXTURE_SUBLOAD_RENDER_DEFERRED );
  230. pObject_terrain->setTexturePreserveImageLevelsEnable( true );

  231. PublicMember::CTS_s_pInstancesToUnref->push_back( pObject_terrain );

  232. vpObject* pObject_house = new vpObject();
  233. pObject_house->setName( "house" );
  234. pObject_house->setCullMask( 0x0FFFFFFFF );
  235. pObject_house->setRenderMask( 0x0FFFFFFFF );
  236. pObject_house->setIsectMask( 0x0FFFFFFFF );
  237. pObject_house->setStrategyEnable( true );
  238. pObject_house->setTranslate( 50 , 100 , 2 );
  239. pObject_house->setRotate( -90 , 0 , 0 );
  240. pObject_house->setScale( 3 , 3 , 3 );
  241. pObject_house->setStaticEnable( false );
  242. pObject_house->setFileName( "farmhouse.flt" );
  243. pObject_house->setAutoPage( vpObject::AUTO_PAGE_SYNCHRONOUS );
  244. pObject_house->setManualLODChild( -1 );
  245. pObject_house->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_COMBINE_LIGHT_POINTS , true );
  246. pObject_house->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_COMBINE_LODS , true );
  247. pObject_house->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_IGNORE_DOF_CONSTRAINTS , false );
  248. pObject_house->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_EXTERNAL_REF_FLAGS , true );
  249. pObject_house->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_GENERIC_NAMES , false );
  250. pObject_house->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_GENERIC_NODES , false );
  251. pObject_house->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_QUADS , false );
  252. pObject_house->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_LIGHT_SOURCES , false );
  253. pObject_house->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_ALL_GEOMETRIES_LIT , false );
  254. pObject_house->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_USE_MATERIAL_DIFFUSE_COLOR , false );
  255. pObject_house->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_MONOCHROME , false );
  256. pObject_house->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_CREATE_ANIMATIONS , true );
  257. pObject_house->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_SHARE_LIGHT_POINT_CONTROLS , true );
  258. pObject_house->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_SHARE_LIGHT_POINT_ANIMATIONS , true );
  259. pObject_house->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_SHARE_LIGHT_POINT_APPEARANCES , true );
  260. pObject_house->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_SURFACE_ATTRIBUTES , false );
  261. pObject_house->setLoaderDetailMultiTextureStage( -1 );
  262. pObject_house->setLoaderBlendTolerance( 0.050000f );
  263. pObject_house->setLoaderUnits( vsNodeLoader::Data::LOADER_UNITS_METERS );
  264. pObject_house->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_OPTIMIZE_GEOMETRIES , true );
  265. pObject_house->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_COLLAPSE_BINDINGS , true );
  266. pObject_house->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_COLLAPSE_TRIANGLE_STRIPS , true );
  267. pObject_house->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_MAKE_INDEXED , false );
  268. pObject_house->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_TANGENT_ORTHONORMALIZATION , false );
  269. pObject_house->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_TANGENT_HARD_EDGE_CHECK , true );
  270. pObject_house->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_TANGENT_PARITY_CHECK , true );
  271. pObject_house->setBuilderNormalMode( vsNodeLoader::Data::BUILDER_NORMAL_MODE_PRESERVE );
  272. pObject_house->setBuilderTangentMode( vsNodeLoader::Data::BUILDER_TANGENT_MODE_GENERATE_PER_VERTEX_PER_PRIMITIVE_AND_ANGLE_WEIGHTED );
  273. pObject_house->setBuilderTangentGenerationMode( vsNodeLoader::Data::BUILDER_TANGENT_GENERATION_MODE_GENERATE_AS_NEEDED );
  274. pObject_house->setBuilderColorTolerance( 0.001000f );
  275. pObject_house->setBuilderNormalTolerance( 0.860000f );
  276. pObject_house->setBuilderVertexTolerance( 0.000010f );
  277. pObject_house->setGeometryOption( vsNodeLoader::Data::GEOMETRY_OPTION_GENERATE_DISPLAY_LISTS , false );
  278. pObject_house->setGeometryOption( vsNodeLoader::Data::GEOMETRY_OPTION_OVERRIDE_VSB , false );
  279. pObject_house->setGeometryFormat( vrGeometryBase::FORMAT_VERTEX_ARRAY , 0x0FFF );
  280. pObject_house->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_FLATTEN , true );
  281. pObject_house->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_CLEAN , true );
  282. pObject_house->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_MERGE_GEOMETRIES , true );
  283. pObject_house->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_COLLAPSE_BINDINGS , true );
  284. pObject_house->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_COLLAPSE_TRIANGLE_STRIPS , true );
  285. pObject_house->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_MAKE_INDEXED , false );
  286. pObject_house->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_VALIDATE , false );
  287. pObject_house->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_OVERRIDE_VSB , false );
  288. pObject_house->setTextureSubloadEnable( false );
  289. pObject_house->setTextureSubloadRender( vpGeometry::TEXTURE_SUBLOAD_RENDER_DEFERRED );
  290. pObject_house->setTexturePreserveImageLevelsEnable( true );

  291. PublicMember::CTS_s_pInstancesToUnref->push_back( pObject_house );

  292. vpObject* pObject_hummar = new vpObject();
  293. pObject_hummar->setName( "hummar" );
  294. pObject_hummar->setCullMask( 0x0FFFFFFFF );
  295. pObject_hummar->setRenderMask( 0x0FFFFFFFF );
  296. pObject_hummar->setIsectMask( 0x0FFFFFFFF );
  297. pObject_hummar->setStrategyEnable( true );
  298. pObject_hummar->setTranslate( 0 , 100 , 2 );
  299. pObject_hummar->setRotate( -180 , 0 , 0 );
  300. pObject_hummar->setScale( 0.3 , 0.3 , 0.3 );
  301. pObject_hummar->setStaticEnable( false );
  302. pObject_hummar->setFileName( "crane.flt" );
  303. pObject_hummar->setAutoPage( vpObject::AUTO_PAGE_SYNCHRONOUS );
  304. pObject_hummar->setManualLODChild( -1 );
  305. pObject_hummar->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_COMBINE_LIGHT_POINTS , true );
  306. pObject_hummar->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_COMBINE_LODS , true );
  307. pObject_hummar->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_IGNORE_DOF_CONSTRAINTS , false );
  308. pObject_hummar->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_EXTERNAL_REF_FLAGS , true );
  309. pObject_hummar->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_GENERIC_NAMES , false );
  310. pObject_hummar->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_GENERIC_NODES , false );
  311. pObject_hummar->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_QUADS , false );
  312. pObject_hummar->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_LIGHT_SOURCES , false );
  313. pObject_hummar->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_ALL_GEOMETRIES_LIT , false );
  314. pObject_hummar->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_USE_MATERIAL_DIFFUSE_COLOR , false );
  315. pObject_hummar->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_MONOCHROME , false );
  316. pObject_hummar->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_CREATE_ANIMATIONS , true );
  317. pObject_hummar->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_SHARE_LIGHT_POINT_CONTROLS , true );
  318. pObject_hummar->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_SHARE_LIGHT_POINT_ANIMATIONS , true );
  319. pObject_hummar->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_SHARE_LIGHT_POINT_APPEARANCES , true );
  320. pObject_hummar->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_SURFACE_ATTRIBUTES , false );
  321. pObject_hummar->setLoaderDetailMultiTextureStage( -1 );
  322. pObject_hummar->setLoaderBlendTolerance( 0.050000f );
  323. pObject_hummar->setLoaderUnits( vsNodeLoader::Data::LOADER_UNITS_METERS );
  324. pObject_hummar->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_OPTIMIZE_GEOMETRIES , true );
  325. pObject_hummar->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_COLLAPSE_BINDINGS , true );
  326. pObject_hummar->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_COLLAPSE_TRIANGLE_STRIPS , true );
  327. pObject_hummar->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_MAKE_INDEXED , false );
  328. pObject_hummar->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_TANGENT_ORTHONORMALIZATION , false );
  329. pObject_hummar->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_TANGENT_HARD_EDGE_CHECK , true );
  330. pObject_hummar->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_TANGENT_PARITY_CHECK , true );
  331. pObject_hummar->setBuilderNormalMode( vsNodeLoader::Data::BUILDER_NORMAL_MODE_PRESERVE );
  332. pObject_hummar->setBuilderTangentMode( vsNodeLoader::Data::BUILDER_TANGENT_MODE_GENERATE_PER_VERTEX_PER_PRIMITIVE_AND_ANGLE_WEIGHTED );
  333. pObject_hummar->setBuilderTangentGenerationMode( vsNodeLoader::Data::BUILDER_TANGENT_GENERATION_MODE_GENERATE_AS_NEEDED );
  334. pObject_hummar->setBuilderColorTolerance( 0.001000f );
  335. pObject_hummar->setBuilderNormalTolerance( 0.860000f );
  336. pObject_hummar->setBuilderVertexTolerance( 0.000010f );
  337. pObject_hummar->setGeometryOption( vsNodeLoader::Data::GEOMETRY_OPTION_GENERATE_DISPLAY_LISTS , false );
  338. pObject_hummar->setGeometryOption( vsNodeLoader::Data::GEOMETRY_OPTION_OVERRIDE_VSB , false );
  339. pObject_hummar->setGeometryFormat( vrGeometryBase::FORMAT_VERTEX_ARRAY , 0x0FFF );
  340. pObject_hummar->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_FLATTEN , true );
  341. pObject_hummar->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_CLEAN , true );
  342. pObject_hummar->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_MERGE_GEOMETRIES , true );
  343. pObject_hummar->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_COLLAPSE_BINDINGS , true );
  344. pObject_hummar->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_COLLAPSE_TRIANGLE_STRIPS , true );
  345. pObject_hummar->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_MAKE_INDEXED , false );
  346. pObject_hummar->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_VALIDATE , false );
  347. pObject_hummar->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_OVERRIDE_VSB , false );
  348. pObject_hummar->setTextureSubloadEnable( false );
  349. pObject_hummar->setTextureSubloadRender( vpGeometry::TEXTURE_SUBLOAD_RENDER_DEFERRED );
  350. pObject_hummar->setTexturePreserveImageLevelsEnable( true );

  351. PublicMember::CTS_s_pInstancesToUnref->push_back( pObject_hummar );

  352. vpObject* pObject_grainhouse = new vpObject();
  353. pObject_grainhouse->setName( "grainhouse" );
  354. pObject_grainhouse->setCullMask( 0x0FFFFFFFF );
  355. pObject_grainhouse->setRenderMask( 0x0FFFFFFFF );
  356. pObject_grainhouse->setIsectMask( 0x0FFFFFFFF );
  357. pObject_grainhouse->setStrategyEnable( true );
  358. pObject_grainhouse->setTranslate( 60 , 180 , 0 );
  359. pObject_grainhouse->setRotate( 0 , 0 , 0 );
  360. pObject_grainhouse->setScale( 1.5 , 1.5 , 1.5 );
  361. pObject_grainhouse->setStaticEnable( false );
  362. pObject_grainhouse->setFileName( "fid163.flt" );
  363. pObject_grainhouse->setAutoPage( vpObject::AUTO_PAGE_SYNCHRONOUS );
  364. pObject_grainhouse->setManualLODChild( -1 );
  365. pObject_grainhouse->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_COMBINE_LIGHT_POINTS , true );
  366. pObject_grainhouse->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_COMBINE_LODS , true );
  367. pObject_grainhouse->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_IGNORE_DOF_CONSTRAINTS , false );
  368. pObject_grainhouse->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_EXTERNAL_REF_FLAGS , true );
  369. pObject_grainhouse->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_GENERIC_NAMES , false );
  370. pObject_grainhouse->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_GENERIC_NODES , false );
  371. pObject_grainhouse->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_QUADS , false );
  372. pObject_grainhouse->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_LIGHT_SOURCES , false );
  373. pObject_grainhouse->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_ALL_GEOMETRIES_LIT , false );
  374. pObject_grainhouse->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_USE_MATERIAL_DIFFUSE_COLOR , false );
  375. pObject_grainhouse->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_MONOCHROME , false );
  376. pObject_grainhouse->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_CREATE_ANIMATIONS , true );
  377. pObject_grainhouse->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_SHARE_LIGHT_POINT_CONTROLS , true );
  378. pObject_grainhouse->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_SHARE_LIGHT_POINT_ANIMATIONS , true );
  379. pObject_grainhouse->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_SHARE_LIGHT_POINT_APPEARANCES , true );
  380. pObject_grainhouse->setLoaderOption( vsNodeLoader::Data::LOADER_OPTION_PRESERVE_SURFACE_ATTRIBUTES , false );
  381. pObject_grainhouse->setLoaderDetailMultiTextureStage( -1 );
  382. pObject_grainhouse->setLoaderBlendTolerance( 0.050000f );
  383. pObject_grainhouse->setLoaderUnits( vsNodeLoader::Data::LOADER_UNITS_METERS );
  384. pObject_grainhouse->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_OPTIMIZE_GEOMETRIES , true );
  385. pObject_grainhouse->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_COLLAPSE_BINDINGS , true );
  386. pObject_grainhouse->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_COLLAPSE_TRIANGLE_STRIPS , true );
  387. pObject_grainhouse->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_MAKE_INDEXED , false );
  388. pObject_grainhouse->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_TANGENT_ORTHONORMALIZATION , false );
  389. pObject_grainhouse->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_TANGENT_HARD_EDGE_CHECK , true );
  390. pObject_grainhouse->setBuilderOption( vsNodeLoader::Data::BUILDER_OPTION_TANGENT_PARITY_CHECK , true );
  391. pObject_grainhouse->setBuilderNormalMode( vsNodeLoader::Data::BUILDER_NORMAL_MODE_PRESERVE );
  392. pObject_grainhouse->setBuilderTangentMode( vsNodeLoader::Data::BUILDER_TANGENT_MODE_GENERATE_PER_VERTEX_PER_PRIMITIVE_AND_ANGLE_WEIGHTED );
  393. pObject_grainhouse->setBuilderTangentGenerationMode( vsNodeLoader::Data::BUILDER_TANGENT_GENERATION_MODE_GENERATE_AS_NEEDED );
  394. pObject_grainhouse->setBuilderColorTolerance( 0.001000f );
  395. pObject_grainhouse->setBuilderNormalTolerance( 0.860000f );
  396. pObject_grainhouse->setBuilderVertexTolerance( 0.000010f );
  397. pObject_grainhouse->setGeometryOption( vsNodeLoader::Data::GEOMETRY_OPTION_GENERATE_DISPLAY_LISTS , false );
  398. pObject_grainhouse->setGeometryOption( vsNodeLoader::Data::GEOMETRY_OPTION_OVERRIDE_VSB , false );
  399. pObject_grainhouse->setGeometryFormat( vrGeometryBase::FORMAT_VERTEX_ARRAY , 0x0FFF );
  400. pObject_grainhouse->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_FLATTEN , true );
  401. pObject_grainhouse->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_CLEAN , true );
  402. pObject_grainhouse->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_MERGE_GEOMETRIES , true );
  403. pObject_grainhouse->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_COLLAPSE_BINDINGS , true );
  404. pObject_grainhouse->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_COLLAPSE_TRIANGLE_STRIPS , true );
  405. pObject_grainhouse->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_MAKE_INDEXED , false );
  406. pObject_grainhouse->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_VALIDATE , false );
  407. pObject_grainhouse->setPostLoadOption( vpGeometryPageable::POST_LOAD_OPTION_OVERRIDE_VSB , false );
  408. pObject_grainhouse->setTextureSubloadEnable( false );
  409. pObject_grainhouse->setTextureSubloadRender( vpGeometry::TEXTURE_SUBLOAD_RENDER_DEFERRED );
  410. pObject_grainhouse->setTexturePreserveImageLevelsEnable( true );

  411. PublicMember::CTS_s_pInstancesToUnref->push_back( pObject_grainhouse );

  412. vpIsectorBump* pIsectorBump_bumpIsector = new vpIsectorBump();
  413. pIsectorBump_bumpIsector->setName( "bumpIsector" );
  414. pIsectorBump_bumpIsector->setEnable( true );
  415. pIsectorBump_bumpIsector->setRenderEnable( false );
  416. pIsectorBump_bumpIsector->setTranslate( 0 , 0 , 0 );
  417. pIsectorBump_bumpIsector->setRotate( 0 , 0 , 0 );
  418. pIsectorBump_bumpIsector->setMode( 0x02 );
  419. pIsectorBump_bumpIsector->setIsectMask( 0x01 );
  420. pIsectorBump_bumpIsector->setStrategyEnable( true );
  421. pIsectorBump_bumpIsector->setDimensions( 5.000000f , 5.000000f , 5.000000f );

  422. PublicMember::CTS_s_pInstancesToUnref->push_back( pIsectorBump_bumpIsector );

  423. vpIsectorTripod* pIsectorTripod_tripodIsector = new vpIsectorTripod();
  424. pIsectorTripod_tripodIsector->setName( "tripodIsector" );
  425. pIsectorTripod_tripodIsector->setEnable( true );
  426. pIsectorTripod_tripodIsector->setRenderEnable( false );
  427. pIsectorTripod_tripodIsector->setTranslate( 0 , 0 , 0 );
  428. pIsectorTripod_tripodIsector->setRotate( 0 , 0 , 0 );
  429. pIsectorTripod_tripodIsector->setMode( 0x02A );
  430. pIsectorTripod_tripodIsector->setIsectMask( 0x0FFFFFFFF );
  431. pIsectorTripod_tripodIsector->setStrategyEnable( true );
  432. pIsectorTripod_tripodIsector->setSegmentZExtent( -5000.000000f , 5000.000000f );
  433. pIsectorTripod_tripodIsector->setDimensions( 20.000000f , 20.000000f );

  434. PublicMember::CTS_s_pInstancesToUnref->push_back( pIsectorTripod_tripodIsector );

  435. vpIsectorServiceInline* pIsectorServiceInline_myIsectorService = new vpIsectorServiceInline();
  436. pIsectorServiceInline_myIsectorService->setName( "myIsectorService" );

  437. PublicMember::CTS_s_pInstancesToUnref->push_back( pIsectorServiceInline_myIsectorService );

  438. vpGroundClamp* pGroundClamp_myGroundClamp = new vpGroundClamp();
  439. pGroundClamp_myGroundClamp->setName( "myGroundClamp" );
  440. pGroundClamp_myGroundClamp->setOffsetFromGround( 0.000000f );

  441. PublicMember::CTS_s_pInstancesToUnref->push_back( pGroundClamp_myGroundClamp );

  442. vpRecyclingService* pRecyclingService_myRecyclingService = vpRecyclingService::instance();
  443. pRecyclingService_myRecyclingService->setMultiThread( vpRecyclingService::MULTITHREAD_INLINE );
  444. pRecyclingService_myRecyclingService->setThreadPriority( vuThread::PRIORITY_NORMAL );
  445. pRecyclingService_myRecyclingService->setThreadProcessor( -1 );
  446. pRecyclingService_myRecyclingService->setRecycleTime( -1 );

  447. vpEnvGlobals* pEnvGlobals_myEnvGlobals = vpEnvGlobals::instance();
  448. pEnvGlobals_myEnvGlobals->setSkyLightEnable( true );
  449. pEnvGlobals_myEnvGlobals->setDominantCelestialLightingEnable( true );
  450. pEnvGlobals_myEnvGlobals->setLocalViewerEnable( false );
  451. pEnvGlobals_myEnvGlobals->setTwoSidedLightingEnable( false );
  452. pEnvGlobals_myEnvGlobals->setEnvironmentMapGenerationEnable( false );

  453. vpEnv* pEnv_myEnv = new vpEnv();
  454. pEnv_myEnv->setName( "myEnv" );
  455. pEnv_myEnv->setDate( 1 , 9 , 2006 );
  456. pEnv_myEnv->setTimeOfDay( 9.250000f );
  457. pEnv_myEnv->setTimeMultiplier( 1.000000f );
  458. pEnv_myEnv->setEphemerisUpdateInterval( 0.000000f );
  459. pEnv_myEnv->setReferencePosition( -117.355103f , 33.301300f );
  460. pEnv_myEnv->setEphemerisTimeZoneOffset( -10000 );
  461. pEnv_myEnv->setSkyColor( 0.513725f , 0.701961f , 0.941176f , 1.000000f );
  462. pEnv_myEnv->setVisibilityType( vpEnvFx::VISIBILITY_TYPE_VERTEX_EXP2 );
  463. pEnv_myEnv->setVisibilityRangeOnset( 0.000000f );
  464. pEnv_myEnv->setVisibilityRangeOpaque( 60000.000000f );
  465. pEnv_myEnv->setVisibilityColor( 0.764706f , 0.858824f , 1.000000f , 1.000000f );
  466. pEnv_myEnv->setHazeColor( 0.772549f , 0.772549f , 0.772549f , 0.445397f );
  467. pEnv_myEnv->setManageVisibilityColorsEnable( true );
  468. pEnv_myEnv->setAmbientLightingColor( 0.000000f , 0.000000f , 0.000000f , 1.000000f );
  469. pEnv_myEnv->setLightColorScale( vpEnv::COLOR_AMBIENT , 1.000000f );
  470. pEnv_myEnv->setLightColorScale( vpEnv::COLOR_DIFFUSE , 1.000000f );
  471. pEnv_myEnv->setLightColorScale( vpEnv::COLOR_SPECULAR , 1.000000f );
  472. pEnv_myEnv->setLightColorScale( vpEnv::COLOR_AMBIENT , 1.000000f );

  473. PublicMember::CTS_s_pInstancesToUnref->push_back( pEnv_myEnv );

  474. vpEnvSun* pEnvSun_myEnvSun = new vpEnvSun();
  475. pEnvSun_myEnvSun->setName( "myEnvSun" );
  476. pEnvSun_myEnvSun->setEnable( true );
  477. pEnvSun_myEnvSun->setTwilightDip( -18.000000f );
  478. pEnvSun_myEnvSun->setGeometryEnable( true );
  479. pEnvSun_myEnvSun->setTextureFile( "sun.inta" );
  480. pEnvSun_myEnvSun->setTextureBlendColor( 1.000000f , 1.000000f , 1.000000f , 1.000000f );
  481. pEnvSun_myEnvSun->setTextureBlendMode( vpEnvSun::TEXTURE_BLEND_MODE_MODULATE );
  482. pEnvSun_myEnvSun->setColor( 0.992156f , 1.000000f , 0.949019f , 1.000000f );
  483. pEnvSun_myEnvSun->setVisibilityRangeRatio( 0.050000f );
  484. pEnvSun_myEnvSun->setAngularSize( 5.500000f );
  485. pEnvSun_myEnvSun->setHorizonAngle( 40.000000f );
  486. pEnvSun_myEnvSun->setHorizonColor( 1.000000f , 0.545098f , 0.239216f , 1.000000f );
  487. pEnvSun_myEnvSun->setHorizonSizeScale( 2.000000f );
  488. pEnvSun_myEnvSun->setHorizonLightColorScale( 0.250000f );

  489. PublicMember::CTS_s_pInstancesToUnref->push_back( pEnvSun_myEnvSun );

  490. vpEnvMoon* pEnvMoon_myEnvMoon = new vpEnvMoon();
  491. pEnvMoon_myEnvMoon->setName( "myEnvMoon" );
  492. pEnvMoon_myEnvMoon->setEnable( true );
  493. pEnvMoon_myEnvMoon->setBrightness( 0.250000f );
  494. pEnvMoon_myEnvMoon->setGeometryEnable( true );
  495. pEnvMoon_myEnvMoon->setTextureFile( "moon.inta" );
  496. pEnvMoon_myEnvMoon->setTextureBlendColor( 1.000000f , 1.000000f , 1.000000f , 1.000000f );
  497. pEnvMoon_myEnvMoon->setTextureBlendMode( vpEnvMoon::TEXTURE_BLEND_MODE_MODULATE );
  498. pEnvMoon_myEnvMoon->setColor( 0.811765f , 0.886275f , 0.937255f , 1.000000f );
  499. pEnvMoon_myEnvMoon->setVisibilityRangeRatio( 0.100000f );
  500. pEnvMoon_myEnvMoon->setAngularSize( 1.500000f );
  501. pEnvMoon_myEnvMoon->setHorizonAngle( 30.000000f );
  502. pEnvMoon_myEnvMoon->setHorizonColor( 0.811765f , 0.886275f , 0.937255f , 1.000000f );
  503. pEnvMoon_myEnvMoon->setHorizonSizeScale( 1.700000f );
  504. pEnvMoon_myEnvMoon->setHorizonLightColorScale( 0.000000f );

  505. PublicMember::CTS_s_pInstancesToUnref->push_back( pEnvMoon_myEnvMoon );

  506. vpEnvSkyDome* pEnvSkyDome_myEnvSkyDome = new vpEnvSkyDome();
  507. pEnvSkyDome_myEnvSkyDome->setName( "myEnvSkyDome" );
  508. pEnvSkyDome_myEnvSkyDome->setEnable( true );
  509. pEnvSkyDome_myEnvSkyDome->setGroundColor( 0.211765f , 0.286275f , 0.149020f , 1.000000f );
  510. pEnvSkyDome_myEnvSkyDome->setGroundEnable( true );
  511. pEnvSkyDome_myEnvSkyDome->setVisibilityRangeRatio( 0 , 0.100000f );
  512. pEnvSkyDome_myEnvSkyDome->setVisibilityRangeRatio( 1 , 0.300000f );
  513. pEnvSkyDome_myEnvSkyDome->setVisibilityRangeRatio( 2 , 0.750000f );
  514. pEnvSkyDome_myEnvSkyDome->setVisibilityRangeRatio( 3 , 0.900000f );
  515. pEnvSkyDome_myEnvSkyDome->setVisibilityRangeRatio( 4 , 1.000000f );
  516. pEnvSkyDome_myEnvSkyDome->setVisibilityRangeRatio( 5 , 1.000000f );
  517. pEnvSkyDome_myEnvSkyDome->setVisibilityRangeRatio( 6 , 1.000000f );

  518. PublicMember::CTS_s_pInstancesToUnref->push_back( pEnvSkyDome_myEnvSkyDome );

  519. vpEnvCloudLayer* pEnvCloudLayer_myEnvCloudLayer = new vpEnvCloudLayer();
  520. pEnvCloudLayer_myEnvCloudLayer->setName( "myEnvCloudLayer" );
  521. pEnvCloudLayer_myEnvCloudLayer->setEnable( true );
  522. pEnvCloudLayer_myEnvCloudLayer->setColor( 0.300000f , 0.300000f , 0.300000f , 1.000000f );
  523. pEnvCloudLayer_myEnvCloudLayer->setElevation( 5000.000000f , 6000.000000f );
  524. pEnvCloudLayer_myEnvCloudLayer->setTransitionRange( 500.000000f , 500.000000f );
  525. pEnvCloudLayer_myEnvCloudLayer->setScudEnable( false );
  526. pEnvCloudLayer_myEnvCloudLayer->setTextureFile( "" );
  527. pEnvCloudLayer_myEnvCloudLayer->setTextureBlendColor( 1.000000f , 1.000000f , 1.000000f , 1.000000f );
  528. pEnvCloudLayer_myEnvCloudLayer->setTextureBlendMode( vpEnvCloudLayer::TEXTURE_BLEND_MODE_MODULATE );
  529. pEnvCloudLayer_myEnvCloudLayer->setTextureTiling( 2.000000f , 2.000000f );
  530. pEnvCloudLayer_myEnvCloudLayer->setMinVisibilityScale( 0.000000f );
  531. pEnvCloudLayer_myEnvCloudLayer->setHorizonColorScale( 1.000000f );
  532. pEnvCloudLayer_myEnvCloudLayer->setCoverageScale( 0.250000f );
  533. pEnvCloudLayer_myEnvCloudLayer->setShadowsEnable( false );
  534. pEnvCloudLayer_myEnvCloudLayer->setShadowsColorPunchThrough( 0.300000f );
  535. pEnvCloudLayer_myEnvCloudLayer->setShadowsContribution( 0.100000f , 0.900000f );

  536. PublicMember::CTS_s_pInstancesToUnref->push_back( pEnvCloudLayer_myEnvCloudLayer );

  537. vpEnvStars* pEnvStars_myEnvStars = new vpEnvStars();
  538. pEnvStars_myEnvStars->setName( "myEnvStars" );
  539. pEnvStars_myEnvStars->setEnable( true );
  540. pEnvStars_myEnvStars->setIntensityThreshold( 0.350000f );
  541. pEnvStars_myEnvStars->setBrightnessThreshold( 0.400000f , 0.250000f );
  542. pEnvStars_myEnvStars->setVisibilityRangeRatio( 0.100000f );
  543. pEnvStars_myEnvStars->setPointSize( 2.300000f );

  544. PublicMember::CTS_s_pInstancesToUnref->push_back( pEnvStars_myEnvStars );

  545. vpEnvWind* pEnvWind_myEnvWind = new vpEnvWind();
  546. pEnvWind_myEnvWind->setName( "myEnvWind" );
  547. pEnvWind_myEnvWind->setEnable( true );
  548. pEnvWind_myEnvWind->setSpeed( 100.000000f );
  549. pEnvWind_myEnvWind->setDirection( 0.000000f , 1.000000f , 0.000000f );

  550. PublicMember::CTS_s_pInstancesToUnref->push_back( pEnvWind_myEnvWind );

  551. vpMotionDrive* pMotionDrive_myMotion1 = new vpMotionDrive();
  552. pMotionDrive_myMotion1->setName( "myMotion1" );
  553. pMotionDrive_myMotion1->setSpeed( 0 );
  554. pMotionDrive_myMotion1->setSpeedLimits( -2 , 2 );
  555. pMotionDrive_myMotion1->setSpeedDelta( 1 , 1 );
  556. pMotionDrive_myMotion1->setHeadingDelta( 1 );

  557. PublicMember::CTS_s_pInstancesToUnref->push_back( pMotionDrive_myMotion1 );

  558. vpMotionDrive* pMotionDrive_myMotion2 = new vpMotionDrive();
  559. pMotionDrive_myMotion2->setName( "myMotion2" );
  560. pMotionDrive_myMotion2->setSpeed( 0 );
  561. pMotionDrive_myMotion2->setSpeedLimits( -200 , 200 );
  562. pMotionDrive_myMotion2->setSpeedDelta( 1 , 1 );
  563. pMotionDrive_myMotion2->setHeadingDelta( 1 );

  564. PublicMember::CTS_s_pInstancesToUnref->push_back( pMotionDrive_myMotion2 );

  565. vpMotionUFO* pMotionUFO_myMotion = new vpMotionUFO();
  566. pMotionUFO_myMotion->setName( "myMotion" );
  567. pMotionUFO_myMotion->setSpeed( 10 );
  568. pMotionUFO_myMotion->setBoost( 50 );
  569. pMotionUFO_myMotion->setBoostTurning( 5 );
  570. pMotionUFO_myMotion->setRateHeading( 40 );
  571. pMotionUFO_myMotion->setRatePitch( 20 );

  572. PublicMember::CTS_s_pInstancesToUnref->push_back( pMotionUFO_myMotion );

  573. vpFxDebris* pFxDebris_debris = new vpFxDebris();
  574. pFxDebris_debris->setName( "debris" );
  575. pFxDebris_debris->setCullMask( 0x0FFFFFFFF );
  576. pFxDebris_debris->setRenderMask( 0x0FFFFFFFF );
  577. pFxDebris_debris->setIsectMask( 0x0FFFFFFFF );
  578. pFxDebris_debris->setStrategyEnable( true );
  579. pFxDebris_debris->setScale( 5 , 5 , 5 );
  580. pFxDebris_debris->setStaticEnable( false );
  581. pFxDebris_debris->setRepeatEnable( false );
  582. pFxDebris_debris->setOverallColor( 1.000000f , 1.000000f , 1.000000f , 1.000000f );
  583. pFxDebris_debris->setTextureBlendColor( 1.000000f , 1.000000f , 1.000000f , 1.000000f );
  584. pFxDebris_debris->setTextureMode( vpFx::TEXTURE_MODE_MODULATE );
  585. pFxDebris_debris->setTextureFile( "debris.inta" );
  586. pFxDebris_debris->setOverallDuration( 4.000000f );
  587. pFxDebris_debris->setFadeDuration( 0.000000f , 0.000000f );
  588. pFxDebris_debris->setTransparencyDepthOffset( 0.000000f );
  589. pFxDebris_debris->setTransparencyDepthRadiusScaler( 0.000000f );
  590. pFxDebris_debris->setDepthWriteEnable( false );
  591. pFxDebris_debris->setWindSource( vpFxParticleSystem::WIND_SOURCE_TABLE );

  592. PublicMember::CTS_s_pInstancesToUnref->push_back( pFxDebris_debris );



  593. //
  594. // Satisfy all references
  595. //



  596. pPipeline_myPipeline->addWindow( pWindow_myWindow );

  597. pWindow_myWindow->addChannel( pChannel_myChannel );



  598. pObserver_myObserver->setStrategy( pMotionUFO_myMotion );
  599. pObserver_myObserver->addChannel( pChannel_myChannel );
  600. pObserver_myObserver->addAttachment( pEnv_myEnv );
  601. pObserver_myObserver->setScene( PublicMember::CTS_pScene_myScene );
  602. pObserver_myObserver->setLookFrom( pTransform_hummarTransform );

  603. pObserver_myObserver1->addChannel( pChannel_myChannel1 );
  604. pObserver_myObserver1->addAttachment( pEnv_myEnv );
  605. pObserver_myObserver1->setScene( PublicMember::CTS_pScene_myScene );
  606. pObserver_myObserver1->setLookFrom( pObject_hummar );

  607. PublicMember::CTS_pScene_myScene->addChild( pObject_terrain );
  608. PublicMember::CTS_pScene_myScene->addChild( pObject_house );
  609. PublicMember::CTS_pScene_myScene->addChild( pObject_hummar );
  610. PublicMember::CTS_pScene_myScene->addChild( pObject_grainhouse );



  611. pObject_house->addChild( pFxDebris_debris );

  612. pObject_hummar->addChild( pTransform_hummarTransform );
  613. pObject_hummar->setStrategy( pMotionDrive_myMotion1 );


  614. pIsectorBump_bumpIsector->setTarget( pObject_house );
  615. pIsectorBump_bumpIsector->setPositionReference( pObject_hummar );

  616. pIsectorTripod_tripodIsector->setTarget( pObject_terrain );

  617. pIsectorServiceInline_myIsectorService->addIsector( pIsectorBump_bumpIsector );

  618. pGroundClamp_myGroundClamp->setIsector( pIsectorTripod_tripodIsector );



  619. pEnv_myEnv->addEnvFx( pEnvSun_myEnvSun );
  620. pEnv_myEnv->addEnvFx( pEnvMoon_myEnvMoon );
  621. pEnv_myEnv->addEnvFx( pEnvSkyDome_myEnvSkyDome );
  622. pEnv_myEnv->addEnvFx( pEnvCloudLayer_myEnvCloudLayer );
  623. pEnv_myEnv->addEnvFx( pEnvWind_myEnvWind );
  624. pEnv_myEnv->addEnvFx( pEnvStars_myEnvStars );







  625. pMotionDrive_myMotion1->setNextStrategy( pGroundClamp_myGroundClamp );



  626. pFxDebris_debris->setTriggerIsector( pIsectorBump_bumpIsector );

  627. }







  628. //
  629. // Main Program
  630. //

  631. UINT PublicMember::CTS_RunBasicThread(LPVOID)
  632. {
  633. // initialize Vega Prime
  634. vp::initialize(__argc,__argv);

  635. // use the code generated by LynX Prime
  636. PublicMember::CTS_Define();

  637. // configure instance
  638. vpKernel::instance()->configure();

  639. //设置窗体
  640. vpWindow* vpWin=*vpWindow::begin();
  641. vpWin->setParent(CTS_RunningWindow);
  642. vpWin->setBorderEnable(false);
  643. vpWin->setFullScreenEnable(true);
  644. vpWin->open();

  645. //帧循环
  646. while(vpKernel::instance()->beginFrame()!=0)
  647. {
  648. vpKernel::instance()->endFrame();
  649. if(!PublicMember::CTS_continueRunVP)
  650. {
  651. vpKernel::instance()->unconfigure();
  652. vp::shutdown ();
  653. return 0;
  654. }
  655. }
  656. return 0;

  657. }
复制代码
PublicMember.h文件

  1. #include "vpModule.h"
  2. #include "vpKernel.h"
  3. #include "vpSearchPath.h"
  4. #include "vpPipeline.h"
  5. #include "vpWindow.h"
  6. #include "vpChannel.h"
  7. #include "vpObserver.h"
  8. #include "vpScene.h"
  9. #include "vpTransform.h"
  10. #include "vpObject.h"
  11. #include "vpIsectorBump.h"
  12. #include "vpIsectorTripod.h"
  13. #include "vpIsectorServiceInline.h"
  14. #include "vpGroundClamp.h"
  15. #include "vpRecyclingService.h"
  16. #include "vpEnvGlobals.h"
  17. #include "vpEnv.h"
  18. #include "vpEnvSun.h"
  19. #include "vpEnvMoon.h"
  20. #include "vpEnvSkyDome.h"
  21. #include "vpEnvCloudLayer.h"
  22. #include "vpEnvStars.h"
  23. #include "vpEnvWind.h"
  24. #include "vpMotionDrive.h"
  25. #include "vpMotionUFO.h"
  26. #include "vpFxDebris.h"
  27. #include "vpApp.h"


  28. typedef vuVector< vuField< vuBase* > > InstancesList;
  29. #pragma once

  30. class PublicMember
  31. {
  32. public:
  33. PublicMember(void);
  34. ~PublicMember(void);
  35. //公共成员函数
  36. static void CTS_Define(void);
  37. static UINT CTS_RunBasicThread(LPVOID);
  38. //公共成员变量
  39. static HWND CTS_RunningWindow;
  40. static bool CTS_continueRunVP;
  41. static CWinThread* CTS_vegaThread;
  42. static InstancesList* CTS_s_pInstancesToUnref;
  43. static vpSearchPath* CTS_pSearchPath_mySearchPath;
  44. static vpScene* CTS_pScene_myScene;

  45. };
复制代码
两个按钮的消息函数
  1. void CvptestDialogDlg::OnBnClickedRun()
  2. {
  3. // TODO: 在此添加控件通知处理程序代码
  4. CWnd *pWnd=GetDlgItem(IDC_grScene);
  5. PublicMember::CTS_RunningWindow=pWnd->GetSafeHwnd();
  6. PublicMember::CTS_continueRunVP=true;
  7. PublicMember::CTS_vegaThread= AfxBeginThread((AFX_THREADPROC)PublicMember::CTS_vegaThread,this);

  8. }

  9. void CvptestDialogDlg::OnBnClickedOk()
  10. {
  11. // TODO: 在此添加控件通知处理程序代码
  12. PublicMember::CTS_continueRunVP=false;
  13. Sleep(1000);
  14. OnOK();
  15. }
复制代码

最近VR访客

sichuanwww 评论于2014-12-25 13:52:35
你这样的代码,看不出问题的所在。
把问题描述清楚,大家才可能帮你
努力挣钱,快乐生活!
阿莱克 评论于2014-12-25 17:26:38
sichuanwww 发表于 2014-12-25 01:52 PM
你这样的代码,看不出问题的所在。
把问题描述清楚,大家才可能帮你

就是代码调试顺利 调试完后会出现对话框 但是 ”运行“按钮貌似是按下状态,我点击“运行”按钮后 没反应,
多次点击后 会提示“vptestDialog.exe 中的 0x003b8a43 处未处理的异常: 0xC0000005: 写入位置 0xd43a9606 时发生访问冲突”   
阿莱克 评论于2014-12-25 17:53:22
阿莱克 发表于 2014-12-25 05:26 PM
就是代码调试顺利 调试完后会出现对话框 但是 ”运行“按钮貌似是按下状态,我点击“运行”按钮后 没反应 ...

这是改后的主函数
  1. UINT PublicMember::CTS_RunBasicThread(LPVOID)
  2. {
  3.     // initialize Vega Prime
  4.     vp::initialize(__argc,__argv);

  5.     // use the code generated by LynX Prime
  6.     PublicMember::CTS_Define();

  7.     // configure  instance
  8.         vpKernel::instance()->configure();

  9.         //设置窗体
  10.         vpWindow* vpWin=*vpWindow::begin();
  11.         vpWin->setParent(CTS_RunningWindow);
  12.         vpWin->setBorderEnable(false);
  13.         vpWin->setFullScreenEnable(true);
  14.         vpWin->open();

  15.         //帧循环
  16.         while(vpKernel::instance()->beginFrame()!=0)
  17.         {
  18.                 vpKernel::instance()->endFrame();
  19.                 if(!PublicMember::CTS_continueRunVP)
  20.                 {
  21.                         vpKernel::instance()->unconfigure();
  22.                         vp::shutdown ();
  23.                         return 0;
  24.                 }
  25.         }
  26.     return 0;

  27. }
复制代码
阿莱克 评论于2014-12-26 17:45:22
帮帮忙啊       点击两次“运行”时弹出 vptestDialog.exe 中的 0x003b6fbb 处未处理的异常: 0xC0000005: 写入位置 0xd43a7b99 时发生访问冲突   但是 “关闭”按钮有效
阿莱克 评论于2014-12-26 18:08:09
阿莱克 发表于 2014-12-25 05:26 PM
就是代码调试顺利 调试完后会出现对话框 但是 ”运行“按钮貌似是按下状态,我点击“运行”按钮后 没反应 ...

代码上传了 能看一下吗?
obuil 评论于2014-12-27 19:03:25
阿莱克 发表于 2014-12-26 06:08 PM
代码上传了 能看一下吗?

两点:
1:你运行时  控制台什么提示?
2:你使用vp的版本,对应的vc的版本,如果是vc2005 的话,可能是你vc没有打sp1补丁
UE4   |   虚幻引擎   |   Unity VR    |    Hololens
阿莱克 评论于2014-12-28 10:06:30
obuil 发表于 2014-12-27 07:03 PM
两点:
1:你运行时  控制台什么提示?
2:你使用vp的版本,对应的vc的版本,如果是vc2005 的话,可能是 ...

1  调试成功后出现对话框,然后 点击“运行”按钮时也没反应 。但是第二次点击“运行”按钮时会提示
vptestDialog.exe 中的 0x003b6fbb 处未处理的异常: 0xC0000005: 写入位置 0xd43a7b99 时发生访问冲突 ”。
阿莱克 评论于2014-12-28 11:11:06
obuil 发表于 2014-12-27 07:03 PM
两点:
1:你运行时  控制台什么提示?
2:你使用vp的版本,对应的vc的版本,如果是vc2005 的话,可能是 ...

我刚才把补丁打好了 可是还是跟以前一样。
阿莱克 评论于2014-12-31 10:17:47
obuil 发表于 2014-12-27 07:03 PM
两点:
1:你运行时  控制台什么提示?
2:你使用vp的版本,对应的vc的版本,如果是vc2005 的话,可能是 ...

老大 帮帮忙啊
阿莱克 评论于2015-1-5 17:31:10
结了!  自己把程序又输了2遍  补丁连续打了3遍  就好了

手机版|VR开发网 ( 津ICP备18009691号 ) 统计 网安备12019202000257

GMT+8, 2020-11-26 09:13 PM

返回顶部