mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-25 11:26:37 +00:00 
			
		
		
		
	Scenenode flip
This commit is contained in:
		
							parent
							
								
									a0947cd432
								
							
						
					
					
						commit
						4dc59dfbdd
					
				
					 19 changed files with 18 additions and 26 deletions
				
			
		|  | @ -8,7 +8,6 @@ | ||||||
| 
 | 
 | ||||||
| #include "../mwworld/ptr.hpp" | #include "../mwworld/ptr.hpp" | ||||||
| 
 | 
 | ||||||
| #include "../mwrender/cellimp.hpp" |  | ||||||
| 
 | 
 | ||||||
| namespace MWClass | namespace MWClass | ||||||
| { | { | ||||||
|  |  | ||||||
|  | @ -8,7 +8,6 @@ | ||||||
| #include "../mwworld/ptr.hpp" | #include "../mwworld/ptr.hpp" | ||||||
| #include "../mwworld/actiontake.hpp" | #include "../mwworld/actiontake.hpp" | ||||||
| 
 | 
 | ||||||
| #include "../mwrender/cellimp.hpp" |  | ||||||
| 
 | 
 | ||||||
| #include "containerutil.hpp" | #include "containerutil.hpp" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -8,7 +8,6 @@ | ||||||
| #include "../mwworld/ptr.hpp" | #include "../mwworld/ptr.hpp" | ||||||
| #include "../mwworld/actiontake.hpp" | #include "../mwworld/actiontake.hpp" | ||||||
| 
 | 
 | ||||||
| #include "../mwrender/cellimp.hpp" |  | ||||||
| 
 | 
 | ||||||
| #include "containerutil.hpp" | #include "containerutil.hpp" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -8,7 +8,6 @@ | ||||||
| #include "../mwworld/ptr.hpp" | #include "../mwworld/ptr.hpp" | ||||||
| #include "../mwworld/actiontake.hpp" | #include "../mwworld/actiontake.hpp" | ||||||
| 
 | 
 | ||||||
| #include "../mwrender/cellimp.hpp" |  | ||||||
| 
 | 
 | ||||||
| #include "containerutil.hpp" | #include "containerutil.hpp" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -8,7 +8,6 @@ | ||||||
| #include "../mwworld/ptr.hpp" | #include "../mwworld/ptr.hpp" | ||||||
| #include "../mwworld/actiontake.hpp" | #include "../mwworld/actiontake.hpp" | ||||||
| 
 | 
 | ||||||
| #include "../mwrender/cellimp.hpp" |  | ||||||
| 
 | 
 | ||||||
| #include "containerutil.hpp" | #include "containerutil.hpp" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -7,8 +7,6 @@ | ||||||
| 
 | 
 | ||||||
| #include "../mwworld/ptr.hpp" | #include "../mwworld/ptr.hpp" | ||||||
| 
 | 
 | ||||||
| #include "../mwrender/cellimp.hpp" |  | ||||||
| 
 |  | ||||||
| namespace MWClass | namespace MWClass | ||||||
| { | { | ||||||
|     void Container::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const |     void Container::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const | ||||||
|  |  | ||||||
|  | @ -9,7 +9,6 @@ | ||||||
| #include "../mwworld/actiontalk.hpp" | #include "../mwworld/actiontalk.hpp" | ||||||
| #include "../mwworld/environment.hpp" | #include "../mwworld/environment.hpp" | ||||||
| 
 | 
 | ||||||
| #include "../mwrender/cellimp.hpp" |  | ||||||
| 
 | 
 | ||||||
| #include "../mwmechanics/mechanicsmanager.hpp" | #include "../mwmechanics/mechanicsmanager.hpp" | ||||||
| 
 | 
 | ||||||
|  | @ -25,6 +24,7 @@ namespace MWClass | ||||||
| 
 | 
 | ||||||
|     void Creature::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const |     void Creature::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const | ||||||
|     { |     { | ||||||
|  |         /*
 | ||||||
|         ESMS::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref = |         ESMS::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref = | ||||||
|             ptr.get<ESM::Creature>(); |             ptr.get<ESM::Creature>(); | ||||||
| 
 | 
 | ||||||
|  | @ -36,11 +36,12 @@ namespace MWClass | ||||||
|             MWRender::Creatures creatures = renderingInterface.getCreatures(); |             MWRender::Creatures creatures = renderingInterface.getCreatures(); | ||||||
|             //creatures.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
 |             //creatures.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
 | ||||||
|             //creatures.insertMesh(ptr, "meshes\\" + model);
 |             //creatures.insertMesh(ptr, "meshes\\" + model);
 | ||||||
|         } |         }*/ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     void Creature::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const |     void Creature::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const | ||||||
|     { |     { | ||||||
|  |         /*
 | ||||||
|         ESMS::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref = |         ESMS::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref = | ||||||
|             ptr.get<ESM::Creature>(); |             ptr.get<ESM::Creature>(); | ||||||
| 
 | 
 | ||||||
|  | @ -49,7 +50,7 @@ namespace MWClass | ||||||
|         assert (ref->base != NULL); |         assert (ref->base != NULL); | ||||||
|         if(!model.empty()){ |         if(!model.empty()){ | ||||||
|             physics.insertActorPhysics(ptr); |             physics.insertActorPhysics(ptr); | ||||||
|         } |         }*/ | ||||||
| 
 | 
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -12,7 +12,6 @@ | ||||||
| #include "../mwworld/environment.hpp" | #include "../mwworld/environment.hpp" | ||||||
| #include "../mwworld/world.hpp" | #include "../mwworld/world.hpp" | ||||||
| 
 | 
 | ||||||
| #include "../mwrender/cellimp.hpp" |  | ||||||
| #include "../mwrender/objects.hpp" | #include "../mwrender/objects.hpp" | ||||||
| 
 | 
 | ||||||
| #include <iostream> | #include <iostream> | ||||||
|  |  | ||||||
|  | @ -8,7 +8,6 @@ | ||||||
| #include "../mwworld/ptr.hpp" | #include "../mwworld/ptr.hpp" | ||||||
| #include "../mwworld/actiontake.hpp" | #include "../mwworld/actiontake.hpp" | ||||||
| 
 | 
 | ||||||
| #include "../mwrender/cellimp.hpp" |  | ||||||
| 
 | 
 | ||||||
| #include "containerutil.hpp" | #include "containerutil.hpp" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -10,8 +10,6 @@ | ||||||
| #include "../mwworld/nullaction.hpp" | #include "../mwworld/nullaction.hpp" | ||||||
| #include "../mwworld/environment.hpp" | #include "../mwworld/environment.hpp" | ||||||
| 
 | 
 | ||||||
| #include "../mwrender/cellimp.hpp" |  | ||||||
| 
 |  | ||||||
| #include "../mwsound/soundmanager.hpp" | #include "../mwsound/soundmanager.hpp" | ||||||
| 
 | 
 | ||||||
| #include "containerutil.hpp" | #include "containerutil.hpp" | ||||||
|  |  | ||||||
|  | @ -8,7 +8,6 @@ | ||||||
| #include "../mwworld/ptr.hpp" | #include "../mwworld/ptr.hpp" | ||||||
| #include "../mwworld/actiontake.hpp" | #include "../mwworld/actiontake.hpp" | ||||||
| 
 | 
 | ||||||
| #include "../mwrender/cellimp.hpp" |  | ||||||
| #include "containerutil.hpp" | #include "containerutil.hpp" | ||||||
| 
 | 
 | ||||||
| namespace MWClass | namespace MWClass | ||||||
|  |  | ||||||
|  | @ -8,8 +8,6 @@ | ||||||
| #include "../mwworld/ptr.hpp" | #include "../mwworld/ptr.hpp" | ||||||
| #include "../mwworld/actiontake.hpp" | #include "../mwworld/actiontake.hpp" | ||||||
| 
 | 
 | ||||||
| #include "../mwrender/cellimp.hpp" |  | ||||||
| 
 |  | ||||||
| #include "containerutil.hpp" | #include "containerutil.hpp" | ||||||
| 
 | 
 | ||||||
| namespace MWClass | namespace MWClass | ||||||
|  |  | ||||||
|  | @ -11,8 +11,6 @@ | ||||||
| #include "../mwworld/environment.hpp" | #include "../mwworld/environment.hpp" | ||||||
| #include "../mwworld/world.hpp" | #include "../mwworld/world.hpp" | ||||||
| 
 | 
 | ||||||
| #include "../mwrender/cellimp.hpp" |  | ||||||
| 
 |  | ||||||
| #include "../mwmechanics/mechanicsmanager.hpp" | #include "../mwmechanics/mechanicsmanager.hpp" | ||||||
| #include <OgreSceneNode.h> | #include <OgreSceneNode.h> | ||||||
| 
 | 
 | ||||||
|  | @ -34,6 +32,7 @@ namespace MWClass | ||||||
| 
 | 
 | ||||||
|     void Npc::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const |     void Npc::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const | ||||||
|     { |     { | ||||||
|  |         /*
 | ||||||
|         ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref = |         ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref = | ||||||
|             ptr.get<ESM::NPC>(); |             ptr.get<ESM::NPC>(); | ||||||
| 
 | 
 | ||||||
|  | @ -45,11 +44,13 @@ namespace MWClass | ||||||
|             MWRender::Npcs npcs = renderingInterface.getNPCs(); |             MWRender::Npcs npcs = renderingInterface.getNPCs(); | ||||||
|             //npcs.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
 |             //npcs.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
 | ||||||
|             //npcs.insertMesh(ptr, "meshes\\" + model);
 |             //npcs.insertMesh(ptr, "meshes\\" + model);
 | ||||||
|         } |         }*/ | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     void Npc::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const |     void Npc::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const | ||||||
|     { |     { | ||||||
|  | 
 | ||||||
|  |         /*
 | ||||||
|         ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref = |         ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref = | ||||||
|             ptr.get<ESM::NPC>(); |             ptr.get<ESM::NPC>(); | ||||||
| 
 | 
 | ||||||
|  | @ -58,7 +59,7 @@ namespace MWClass | ||||||
|         assert (ref->base != NULL); |         assert (ref->base != NULL); | ||||||
|         if(!model.empty()){ |         if(!model.empty()){ | ||||||
|             physics.insertActorPhysics(ptr); |             physics.insertActorPhysics(ptr); | ||||||
|         } |         }*/ | ||||||
| 
 | 
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -8,7 +8,6 @@ | ||||||
| #include "../mwworld/ptr.hpp" | #include "../mwworld/ptr.hpp" | ||||||
| #include "../mwworld/actiontake.hpp" | #include "../mwworld/actiontake.hpp" | ||||||
| 
 | 
 | ||||||
| #include "../mwrender/cellimp.hpp" |  | ||||||
| 
 | 
 | ||||||
| #include "containerutil.hpp" | #include "containerutil.hpp" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -8,8 +8,6 @@ | ||||||
| #include "../mwworld/ptr.hpp" | #include "../mwworld/ptr.hpp" | ||||||
| #include "../mwworld/actiontake.hpp" | #include "../mwworld/actiontake.hpp" | ||||||
| 
 | 
 | ||||||
| #include "../mwrender/cellimp.hpp" |  | ||||||
| 
 |  | ||||||
| #include "containerutil.hpp" | #include "containerutil.hpp" | ||||||
| 
 | 
 | ||||||
| namespace MWClass | namespace MWClass | ||||||
|  |  | ||||||
|  | @ -8,7 +8,6 @@ | ||||||
| #include "../mwworld/ptr.hpp" | #include "../mwworld/ptr.hpp" | ||||||
| #include "../mwworld/actiontake.hpp" | #include "../mwworld/actiontake.hpp" | ||||||
| 
 | 
 | ||||||
| #include "../mwrender/cellimp.hpp" |  | ||||||
| 
 | 
 | ||||||
| #include "containerutil.hpp" | #include "containerutil.hpp" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -23,8 +23,11 @@ bool Objects::lightOutQuadInLin = false; | ||||||
| 
 | 
 | ||||||
| int Objects::uniqueID = 0; | int Objects::uniqueID = 0; | ||||||
| 
 | 
 | ||||||
|  | void Objects::setMwRoot(Ogre::SceneNode* root){ | ||||||
|  |     mwRoot = root; | ||||||
|  | } | ||||||
| void Objects::insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_){ | void Objects::insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_){ | ||||||
|     Ogre::SceneNode* root = mRend.getScene()->getRootSceneNode(); |     Ogre::SceneNode* root = mwRoot; | ||||||
|     Ogre::SceneNode* cellnode; |     Ogre::SceneNode* cellnode; | ||||||
|     if(mCellSceneNodes.find(ptr.getCell()) == mCellSceneNodes.end()) |     if(mCellSceneNodes.find(ptr.getCell()) == mCellSceneNodes.end()) | ||||||
|     { |     { | ||||||
|  |  | ||||||
|  | @ -13,6 +13,7 @@ class Objects{ | ||||||
| 	OEngine::Render::OgreRenderer &mRend; | 	OEngine::Render::OgreRenderer &mRend; | ||||||
| 	std::map<MWWorld::Ptr::CellStore *, Ogre::SceneNode *> mCellSceneNodes; | 	std::map<MWWorld::Ptr::CellStore *, Ogre::SceneNode *> mCellSceneNodes; | ||||||
| 	std::map<MWWorld::Ptr::CellStore *, Ogre::StaticGeometry*> mSG; | 	std::map<MWWorld::Ptr::CellStore *, Ogre::StaticGeometry*> mSG; | ||||||
|  |     Ogre::SceneNode* mwRoot; | ||||||
|     bool isStatic; |     bool isStatic; | ||||||
|     static int uniqueID; |     static int uniqueID; | ||||||
|     static bool lightConst; |     static bool lightConst; | ||||||
|  | @ -38,6 +39,7 @@ public: | ||||||
|     void deleteObject (const std::string& handle); |     void deleteObject (const std::string& handle); | ||||||
|     void removeCell(const MWWorld::Ptr& ptr); |     void removeCell(const MWWorld::Ptr& ptr); | ||||||
|     void buildStaticGeometry(ESMS::CellStore<MWWorld::RefData> &cell); |     void buildStaticGeometry(ESMS::CellStore<MWWorld::RefData> &cell); | ||||||
|  |     void setMwRoot(Ogre::SceneNode* root); | ||||||
| 
 | 
 | ||||||
| 	 | 	 | ||||||
|     /// insert a light related to the most recent insertBegin call.
 |     /// insert a light related to the most recent insertBegin call.
 | ||||||
|  |  | ||||||
|  | @ -45,6 +45,7 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const | ||||||
|     SceneNode *rt = rend.getScene()->getRootSceneNode(); |     SceneNode *rt = rend.getScene()->getRootSceneNode(); | ||||||
|     mwRoot = rt->createChildSceneNode(); |     mwRoot = rt->createChildSceneNode(); | ||||||
|     mwRoot->pitch(Degree(-90)); |     mwRoot->pitch(Degree(-90)); | ||||||
|  |     objects.setMwRoot(mwRoot); | ||||||
| 
 | 
 | ||||||
|     //used to obtain ingame information of ogre objects (which are faced or selected)
 |     //used to obtain ingame information of ogre objects (which are faced or selected)
 | ||||||
|     mRaySceneQuery = rend.getScene()->createRayQuery(Ray()); |     mRaySceneQuery = rend.getScene()->createRayQuery(Ray()); | ||||||
|  | @ -220,4 +221,6 @@ void RenderingManager::toggleLight() | ||||||
|   setAmbientMode(); |   setAmbientMode(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue