当前位置: 首页>>代码示例>>C++>>正文


C++ NxScene类代码示例

本文整理汇总了C++中NxScene的典型用法代码示例。如果您正苦于以下问题:C++ NxScene类的具体用法?C++ NxScene怎么用?C++ NxScene使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了NxScene类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetScene

void plSimulationMgr::UpdateDetectorsInScene(plKey world, plKey avatar, hsPoint3& pos, bool entering)
{
    // search thru the actors in a scene looking for convex hull detectors and see if the avatar is inside it
    // ... and then send appropiate collision message if needed
    NxScene* scene = GetScene(world);
    plSceneObject* avObj = plSceneObject::ConvertNoRef(avatar->ObjectIsLoaded());
    const plCoordinateInterface* ci = avObj->GetCoordinateInterface();
    hsPoint3 soPos = ci->GetWorldPos();
    if (scene)
    {
        uint32_t numActors = scene->getNbActors();
        NxActor** actors = scene->getActors();

        for (int i = 0; i < numActors; i++)
        {
            plPXPhysical* physical = (plPXPhysical*)actors[i]->userData;
            if (physical && physical->DoDetectorHullWorkaround())
            {
                if ( physical->IsObjectInsideHull(pos) )
                {
                    physical->SetInsideConvexHull(entering);
                    // we are entering this world... say we entered this detector
                    ISendCollisionMsg(physical->GetObjectKey(), avatar, entering);
                }
            }
        }
    }
}
开发者ID:branan,项目名称:Plasma-nobink,代码行数:28,代码来源:plSimulationMgr.cpp

示例2: IHandleResize

void plPXPhysicalControllerCore::IHandleResize()
{

    uint32_t collideFlags =
        1<<plSimDefs::kGroupStatic |
        1<<plSimDefs::kGroupAvatarBlocker |
        1<<plSimDefs::kGroupDynamic;
    if(!IsSeeking())
    {
        collideFlags|=(1<<plSimDefs::kGroupExcludeRegion);
    }
    NxScene* myscene = plSimulationMgr::GetInstance()->GetScene(this->fWorldKey);
//  NxShape** response=new NxShape*[2];
    
    NxVec3 center(fLocalPosition.fX,fLocalPosition.fY,fLocalPosition.fZ+fPreferedRadius);
    NxSegment Seg(center,center);
    const NxCapsule newCap(Seg,fPreferedRadius);
    int numintersect =myscene->checkOverlapCapsule(newCap,NX_ALL_SHAPES,collideFlags);
    //with new capsule dimensions check for overlap
    //with objects we would collide with
    
    if(numintersect==0)
    {
        fHeight=fPreferedHeight;
        fRadius=fPreferedRadius;
        fController->setRadius(fRadius);
        fController->setHeight(fHeight);
        
        fNeedsResize=false;
    }

//  delete[] response;
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:33,代码来源:plPXPhysicalControllerCore.cpp

示例3: create

		void create(NxScene& scene, const NxVec3& pos, float rad, NxActor* holder)
		{
			NxActorDesc actorDesc;
			NxBodyDesc bodyDesc;

			bodyDesc.solverIterationCount = 20;

			// steer axis
			bodyDesc.mass = 50;
			bodyDesc.massSpaceInertia = NxVec3(1,1,1);
			actorDesc.body = &bodyDesc;
			actorDesc.shapes.clear();

			actorDesc.globalPose.t = pos;
			steerAxis = scene.createActor(actorDesc);
			wheel.create(scene, pos, rad, steerAxis);

			// revolute joint connecting steerAxis with the holder
			NxRevoluteJointDesc revJointDesc;
			revJointDesc.projectionMode = NX_JPM_POINT_MINDIST;
			revJointDesc.actor[0] = steerAxis;
			revJointDesc.actor[1] = holder;
			revJointDesc.setGlobalAnchor(pos);
			revJointDesc.setGlobalAxis(NxVec3(0,1,0));
			steerJoint = (NxRevoluteJoint*)scene.createJoint(revJointDesc);

			// disable collision detection 
			scene.setActorPairFlags(*wheel.wheel, *holder, NX_IGNORE_PAIR);
		}
开发者ID:Fliper12,项目名称:darkbasicpro,代码行数:29,代码来源:PhysXWrapper.cpp

示例4:

/**
*  @brief
*    Constructor
*/
BodySphere::BodySphere(PLPhysics::World &cWorld, float fRadius, bool bStatic) :
	PLPhysics::BodySphere(cWorld, ((World&)cWorld).CreateBodyImpl(), fRadius)
{
	// Get the PhysX physics scene
	NxScene *pPhysXScene = ((World&)cWorld).GetPhysXScene();
	if (pPhysXScene) {
		// Create body
		NxBodyDesc BodyDesc;
		BodyDesc.angularDamping = 0.5f;
		// [TODO] Do we need this setting?
	//	BodyDesc.maxAngularVelocity = 10.0f;

		NxSphereShapeDesc SphereDesc;
		SphereDesc.radius = m_fRadius;

		NxActorDesc ActorDesc;
		ActorDesc.shapes.pushBack(&SphereDesc);
		if (!bStatic)
			ActorDesc.body = &BodyDesc;
		ActorDesc.density = 10.0f;
		// [TODO] Do we need this setting?
	//	ActorDesc.globalPose.t  = pos;
		NxActor *pPhysXActor = pPhysXScene->createActor(ActorDesc);

		// Initialize the PhysX physics actor
		((BodyImpl&)GetBodyImpl()).InitializePhysXActor(*this, *pPhysXActor);
	}
}
开发者ID:ByeDream,项目名称:pixellight,代码行数:32,代码来源:BodySphere.cpp

示例5: SpamMsg

plPXPhysical::~plPXPhysical()
{
    SpamMsg(plSimulationMgr::Log("Destroying physical %s", GetKeyName().c_str()));

    if (fActor)
    {
        // Grab any mesh we may have (they need to be released manually)
        NxConvexMesh* convexMesh = nil;
        NxTriangleMesh* triMesh = nil;
        NxShape* shape = fActor->getShapes()[0];
        if (NxConvexShape* convexShape = shape->isConvexMesh())
            convexMesh = &convexShape->getConvexMesh();
        else if (NxTriangleMeshShape* trimeshShape = shape->isTriangleMesh())
            triMesh = &trimeshShape->getTriangleMesh();

        if (!fActor->isDynamic())
            plPXPhysicalControllerCore::RebuildCache();

        if (fActor->isDynamic() && fActor->readBodyFlag(NX_BF_KINEMATIC))
        {
            if (fGroup == plSimDefs::kGroupDynamic)
                fNumberAnimatedPhysicals--;
            else
                fNumberAnimatedActivators--;
        }

        // Release the actor
        NxScene* scene = plSimulationMgr::GetInstance()->GetScene(fWorldKey);
        scene->releaseActor(*fActor);
        fActor = nil;

        // Now that the actor is freed, release the mesh
        if (convexMesh)
            plSimulationMgr::GetInstance()->GetSDK()->releaseConvexMesh(*convexMesh);
        if (triMesh)
            plSimulationMgr::GetInstance()->GetSDK()->releaseTriangleMesh(*triMesh);

        // Release the scene, so it can be cleaned up if no one else is using it
        plSimulationMgr::GetInstance()->ReleaseScene(fWorldKey);
    }

    if (fWorldHull)
        delete [] fWorldHull;
    if (fSaveTriangles)
        delete [] fSaveTriangles;

    delete fProxyGen;

    // remove sdl modifier
    plSceneObject* sceneObj = plSceneObject::ConvertNoRef(fObjectKey->ObjectIsLoaded());
    if (sceneObj && fSDLMod)
    {
        sceneObj->RemoveModifier(fSDLMod);
    }
    delete fSDLMod;
}
开发者ID:branan,项目名称:Plasma-nobink,代码行数:56,代码来源:plPXPhysical.cpp

示例6: SweepControllerPath

int plPXPhysicalControllerCore::SweepControllerPath(const hsPoint3& startPos, const hsPoint3& endPos, hsBool vsDynamics, hsBool vsStatics, 
                            uint32_t& vsSimGroups, std::multiset< plControllerSweepRecord >& WhatWasHitOut)
{
    NxCapsule tempCap;
    tempCap.p0 =plPXConvert::Point( startPos);
    tempCap.p0.z = tempCap.p0.z + fPreferedRadius;
    tempCap.radius = fPreferedRadius ;
    tempCap.p1 = tempCap.p0;
    tempCap.p1.z = tempCap.p1.z + fPreferedHeight;

    NxVec3 vec;
    vec.x = endPos.fX - startPos.fX;
    vec.y = endPos.fY - startPos.fY;
    vec.z = endPos.fZ - startPos.fZ;

    int numberofHits = 0;
    int HitsReturned = 0;
    WhatWasHitOut.clear();
    NxScene *myscene = plSimulationMgr::GetInstance()->GetScene(fWorldKey);
    NxSweepQueryHit whatdidIhit[10];
    unsigned int flags = NX_SF_ALL_HITS;
    if(vsDynamics)
        flags |= NX_SF_DYNAMICS;
    if(vsStatics)
        flags |= NX_SF_STATICS;
    numberofHits = myscene->linearCapsuleSweep(tempCap, vec, flags, nil, 10, whatdidIhit, nil, vsSimGroups);
    if(numberofHits)
    {//we hit a dynamic object lets make sure it is not animatable
        for(int i=0; i<numberofHits; i++)
        {
            plControllerSweepRecord CurrentHit;
            CurrentHit.ObjHit=(plPhysical*)whatdidIhit[i].hitShape->getActor().userData;
            CurrentHit.Norm.fX = whatdidIhit[i].normal.x;
            CurrentHit.Norm.fY = whatdidIhit[i].normal.y;
            CurrentHit.Norm.fZ = whatdidIhit[i].normal.z;
            if(CurrentHit.ObjHit != nil)
            {
                hsPoint3 where;
                where.fX = whatdidIhit[i].point.x;
                where.fY = whatdidIhit[i].point.y;
                where.fZ = whatdidIhit[i].point.z;
                CurrentHit.locHit = where;
                CurrentHit.TimeHit = whatdidIhit[i].t ;
                WhatWasHitOut.insert(CurrentHit);
                HitsReturned++;
            }
        }
    }

    return HitsReturned;
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:51,代码来源:plPXPhysicalControllerCore.cpp

示例7: IDeleteController

void plPXPhysicalControllerCore::IDeleteController()
{
    if (fController)
    {
        gControllerMgr.releaseController(*fController);
        fController = nil;

        if (fKinematicActor)
        {
            NxScene* scene = plSimulationMgr::GetInstance()->GetScene(fWorldKey);
            scene->releaseActor(*fKinematicActor);
            fKinematicActor = nil;
        }
        plSimulationMgr::GetInstance()->ReleaseScene(fWorldKey);
    }
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:16,代码来源:plPXPhysicalControllerCore.cpp

示例8:

CarActor::CarActor(NxScene &scene, const VC3 &position)
{
	NxBoxShapeDesc boxDesc1;
	//boxDesc1.dimensions = NxVec3(2.65f, 0.55f, 1.05f);
	boxDesc1.dimensions = NxVec3(1.05f, 0.55f, 2.65f);
	boxDesc1.localPose.t.set(NxVec3(0, boxDesc1.dimensions.y, 0));

	NxBoxShapeDesc boxDesc2;
	//boxDesc2.dimensions = NxVec3(1.30f, 0.77f - boxDesc1.dimensions.y, 0.84f);
	boxDesc2.dimensions = NxVec3(0.84f, 0.77f - boxDesc1.dimensions.y, 1.30f);
	boxDesc2.localPose.t.set(NxVec3(0, (boxDesc1.dimensions.y * 2.f) + boxDesc2.dimensions.y, 0));

	NxBodyDesc bodyDesc;
	NxActorDesc actorDesc;
	actorDesc.body = &bodyDesc;
	actorDesc.density = 10.f;
	actorDesc.shapes.pushBack(&boxDesc1);
	actorDesc.shapes.pushBack(&boxDesc2);
	actorDesc.globalPose.t.set(NxVec3(position.x, position.y, position.z));

	actor = scene.createActor(actorDesc);

	this->scene = &scene;
	init();
}
开发者ID:DeejStar,项目名称:Shadowgrounds-Redux,代码行数:25,代码来源:car_actor.cpp

示例9: CreateCCDSkeleton

BoxActor::BoxActor(NxScene &scene, const VC3 &sizes, const VC3 &position, const VC3 &localPosition, bool ccd, float ccdMaxThickness)
{
	NxBodyDesc bodyDesc;
	//bodyDesc.solverIterationCount = 2;

	NxBoxShapeDesc boxDesc;
	boxDesc.dimensions = NxVec3(sizes.x, sizes.y, sizes.z);
	boxDesc.localPose.t.set(NxVec3(localPosition.x, localPosition.y + sizes.y, localPosition.z));

	// CCD, but for thin objects only... --jpk
	if (ccd && (sizes.x*2 < ccdMaxThickness || sizes.y*2 < ccdMaxThickness || sizes.z*2 < ccdMaxThickness))
	{
		VC3 ccdSizes = sizes * 0.6f;
		boxDesc.ccdSkeleton = CreateCCDSkeleton(ccdSizes);
		boxDesc.shapeFlags |= NX_SF_DYNAMIC_DYNAMIC_CCD;

		// also, in this case, a minimal skin width too.
		boxDesc.skinWidth = 0.002f;
	}

	NxActorDesc actorDesc;
	actorDesc.body = &bodyDesc;
	actorDesc.density = 10.f;
	actorDesc.shapes.pushBack(&boxDesc);
	actorDesc.globalPose.t.set(NxVec3(position.x, position.y, position.z));

	// !!!!!!!!!!!!!!
	//actorDesc.managedHwSceneIndex = 1;

	actor = scene.createActor(actorDesc);

	this->scene = &scene;
	init();
}
开发者ID:sopyer,项目名称:Shadowgrounds,代码行数:34,代码来源:box_actor.cpp

示例10: DetectorLog

void plPXPhysicalControllerCore::IInformDetectors(bool entering,bool deferUntilNextSim=true)
{
    static const NxU32 DetectorFlag= 1<<plSimDefs::kGroupDetector;
    if (fController)
    {
#ifndef PLASMA_EXTERNAL_RELEASE
        DetectorLog("Informing from plPXPhysicalControllerCore::IInformDetectors");
#endif  
        NxScene* scene = plSimulationMgr::GetInstance()->GetScene(fWorldKey);
        int kNumofShapesToStore=30;
        NxCapsule cap;
        GetWorldSpaceCapsule(cap);
        NxShape* shapes[30];
        int numCollided=scene->overlapCapsuleShapes(cap,NX_ALL_SHAPES,kNumofShapesToStore,shapes,NULL,DetectorFlag,NULL,true);
        for (int i=0;i<numCollided;i++)
        {
            NxActor* myactor=&(shapes[i]->getActor());
            
            if (myactor)
            {
                plPXPhysical* physical = (plPXPhysical*)myactor->userData;
                if (physical)
                {
                    bool doReport = physical->DoReportOn(plSimDefs::kGroupAvatar);
                    if(doReport)
                    {
                        plCollideMsg* msg = new plCollideMsg;
                        msg->fOtherKey = fOwner;
                        msg->fEntering = entering;
                        msg->AddReceiver(physical->GetObjectKey());
                        if(!deferUntilNextSim)
                        {
                            DetectorLog("Sending an %s msg to %s" , entering? "entering":"exit", physical->GetObjectKey()->GetName().c_str());
                            msg->Send();
                        }
                        else
                        {
                            DetectorLog("Queuing an %s msg to %s, which will be sent after the client update" , entering? "entering":"exit", physical->GetObjectKey()->GetName().c_str());
                            plgDispatch::Dispatch()->MsgQueue(msg);
                        }
                    }
                }
            }
        }
        DetectorLog("Done informing from plPXPhysicalControllerCore::IInformDetectors");
    }
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:47,代码来源:plPXPhysicalControllerCore.cpp

示例11: GetKey

void plSimulationMgr::ReleaseScene(plKey world)
{
    if (!world)
        world = GetKey();

    SceneMap::iterator it = fScenes.find(world);
    hsAssert(it != fScenes.end(), "Unknown scene");
    if (it != fScenes.end())
    {
        NxScene* scene = it->second;
        if (scene->getNbActors() == 0)
        {
            fSDK->releaseScene(*scene);
            fScenes.erase(it);
        }
    }
}
开发者ID:branan,项目名称:Plasma-nobink,代码行数:17,代码来源:plSimulationMgr.cpp

示例12:

/**
*  @brief
*    Constructor
*/
JointSlider::JointSlider(PLPhysics::World &cWorld, PLPhysics::Body *pParentBody, PLPhysics::Body *pChildBody,
						 const Vector3 &vPivotPoint, const Vector3 &vPinDir) :
	PLPhysics::JointSlider(cWorld, ((World&)cWorld).CreateJointImpl(), pParentBody, pChildBody, vPivotPoint, vPinDir)
{
	// Get the PhysX physics scene
	NxScene *pPhysXScene = ((World&)cWorld).GetPhysXScene();
	if (pPhysXScene) {
		// Create the PhysX physics joint
		NxCylindricalJointDesc sJointDesc;
		sJointDesc.actor[0] = pParentBody ? ((BodyImpl&)pParentBody->GetBodyImpl()).GetPhysXActor() : nullptr;
		sJointDesc.actor[1] = pChildBody  ? ((BodyImpl&)pChildBody ->GetBodyImpl()).GetPhysXActor() : nullptr;
		sJointDesc.setGlobalAnchor(NxVec3(m_vPivotPoint.x, m_vPivotPoint.y, m_vPivotPoint.z));
		sJointDesc.setGlobalAxis(NxVec3(m_vPinDir.x, m_vPinDir.y, m_vPinDir.z));
		NxJoint *pPhysXJoint = pPhysXScene->createJoint(sJointDesc);

		// Initialize the PhysX physics joint
		((JointImpl&)GetJointImpl()).InitializePhysXJoint(*this, *pPhysXJoint);
	}
}
开发者ID:ByeDream,项目名称:pixellight,代码行数:23,代码来源:JointSlider.cpp

示例13: DetectorLogYellow

void plSimulationMgr::ISendUpdates()
{
    for (CollisionVec::iterator it = fCollideMsgs.begin(); it != fCollideMsgs.end(); ++it)
    {
        plCollideMsg* pMsg = *it;
        DetectorLogYellow("Collision: %s was triggered by %s. Sending an %s msg", pMsg->GetReceiver(0)->GetName().c_str(),
                          pMsg->fOtherKey ? pMsg->fOtherKey->GetName().c_str() : "(nil)" , pMsg->fEntering ? "'enter'" : "'exit'");
        plgDispatch::Dispatch()->MsgSend(pMsg);
    }
    fCollideMsgs.clear();

    SceneMap::iterator it = fScenes.begin();
    for (; it != fScenes.end(); it++)
    {
        NxScene* scene = it->second;
        uint32_t numActors = scene->getNbActors();
        NxActor** actors = scene->getActors();

        for (int i = 0; i < numActors; i++)
        {
            plPXPhysical* physical = (plPXPhysical*)actors[i]->userData;
            if (physical)
            {
                // apply any hit forces
                physical->ApplyHitForce();

                if (physical->GetSceneNode())
                {
                    physical->SendNewLocation();
                }
                else
                {
                    // if there's no scene node, it's not active (probably about to be collected)
                    const plKey physKey = physical->GetKey();
                    if (physKey)
                    {
                        const plString &physName = physical->GetKeyName();
                        if (!physName.IsNull())
                        {
                            plSimulationMgr::Log("Removing physical <%s> because of missing scene node.\n", physName.c_str());
                        }
                    }
//                  Remove(physical);
                }
            }
        }

//      // iterate through the db types, which are powers-of-two enums.
//      for( plLOSDB db = static_cast<plLOSDB>(1) ;
//          db < plSimDefs::kLOSDBMax;
//          db = static_cast<plLOSDB>(db << 1) )
//      {
//          fLOSSolvers[db]->Resolve(fSubspace);
//      }
//      if(fNeedLOSCullPhase)
//      {
//          for( plLOSDB db = static_cast<plLOSDB>(1) ;
//              db < plSimDefs::kLOSDBMax;
//              db = static_cast<plLOSDB>(db << 1) )
//          {
//              fLOSSolvers[db]->Resolve(fSubspace);
//          }
//          fNeedLOSCullPhase = false;
//      }
    }
}
开发者ID:branan,项目名称:Plasma-nobink,代码行数:66,代码来源:plSimulationMgr.cpp

示例14: plProfile_IncCount

void plSimulationMgr::Advance(float delSecs)
{
    if (fSuspended)
        return;

    plProfile_IncCount(StepLen, (int)(delSecs*1000));

#ifndef PLASMA_EXTERNAL_RELASE
    uint32_t stepTime = hsTimer::GetPrecTickCount();
#endif
    plProfile_BeginTiming(Step);
    plPXPhysicalControllerCore::UpdatePrestep(delSecs);
    plPXPhysicalControllerCore::UpdatePoststep( delSecs);
    
    for (SceneMap::iterator it = fScenes.begin(); it != fScenes.end(); it++)
    {
        NxScene* scene = it->second;
        bool do_advance = true;
        if (fSubworldOptimization)
        {
            plKey world = (plKey)it->first;
            if (world == GetKey())
                world = nil;
            do_advance = plPXPhysicalControllerCore::AnyControllersInThisWorld(world);
        }
        if (do_advance)
        {
            scene->simulate(delSecs);
            scene->flushStream();
            scene->fetchResults(NX_RIGID_BODY_FINISHED, true);
        }
    }
    plPXPhysicalControllerCore::UpdatePostSimStep(delSecs);

    plProfile_EndTiming(Step);
#ifndef PLASMA_EXTERNAL_RELEASE
    if(plSimulationMgr::fDisplayAwakeActors)IDrawActiveActorList();
#endif 
    if (fExtraProfile)
    {
        int contacts = 0, dynActors = 0, dynShapes = 0, awake = 0, stShapes=0, actors=0, scenes=0, controllers=0 ;
        for (SceneMap::iterator it = fScenes.begin(); it != fScenes.end(); it++)
        {
            bool do_advance = true;
            if (fSubworldOptimization)
            {
                plKey world = (plKey)it->first;
                if (world == GetKey())
                    world = nil;
                do_advance = plPXPhysicalControllerCore::AnyControllersInThisWorld(world);
            }
            if (do_advance)
            {
                NxScene* scene = it->second;
                NxSceneStats stats;
                scene->getStats(stats);

                contacts += stats.numContacts;
                dynActors += stats.numDynamicActors;
                dynShapes += stats.numDynamicShapes;
                awake += stats.numDynamicActorsInAwakeGroups;
                stShapes += stats.numStaticShapes;
                actors += stats.numActors;
                scenes += 1;
                controllers += plPXPhysicalControllerCore::NumControllers();
            }
        }

        plProfile_IncCount(Awake, awake);
        plProfile_IncCount(Contacts, contacts);
        plProfile_IncCount(DynActors, dynActors);
        plProfile_IncCount(DynShapes, dynShapes);
        plProfile_IncCount(StaticShapes, stShapes);
        plProfile_IncCount(Actors, actors);
        plProfile_IncCount(Scenes, scenes);
        plProfile_IncCount(Controllers, controllers);
    }

    plProfile_IncCount(AnimatedPhysicals, plPXPhysical::fNumberAnimatedPhysicals);
    plProfile_IncCount(AnimatedActivators, plPXPhysical::fNumberAnimatedActivators);

    fSoundMgr->Update();

    plProfile_BeginTiming(ProcessSyncs);
    IProcessSynchs();
    plProfile_EndTiming(ProcessSyncs);

    plProfile_BeginTiming(UpdateContexts);
    ISendUpdates();
    plProfile_EndTiming(UpdateContexts);
}
开发者ID:branan,项目名称:Plasma-nobink,代码行数:91,代码来源:plSimulationMgr.cpp

示例15: Destroy

CVoid CScene::Destroy()
{
	NxScene* tempScene = gPhysXscene/*gPhysicsSDK->getScene(i)*/;
	if(tempScene && !g_clickedNew && !g_clickedOpen)
	{
		for( CUInt i = 0; i < m_instanceGeometries.size(); i++ )
		{
			CInstanceGeometry* m_instanceGeo = m_instanceGeometries[i];
			if( tempScene )
			{
				for( CUInt j = 0; j < tempScene->getNbActors(); j++ )
				{
					CChar actorName[MAX_NAME_SIZE];
					if( !tempScene->getActors()[j]->getName() ) continue;
					Cpy( actorName, tempScene->getActors()[j]->getName() );
					if( !Cmp(m_instanceGeo->m_physXName, "\n" ) && Cmp( actorName, m_instanceGeo->m_physXName ) )
					{
						for(CInt nItem =0 ; nItem <  ex_pVandaEngine1Dlg->m_listBoxPhysXElements.GetItemCount(); nItem++)
						{
							CString strText = ex_pVandaEngine1Dlg->m_listBoxPhysXElements.GetItemText(nItem, 0);
							char charPtr[MAX_NAME_SIZE];
							sprintf(charPtr, "%s", strText);
							if(Cmp( m_instanceGeo->m_physXName, charPtr ) )
							{
								ex_pVandaEngine1Dlg->m_listBoxPhysXElements.DeleteItem(nItem);
								ex_pVandaEngine1Dlg->SortPhysXList();
							}
						}

						tempScene->releaseActor( *tempScene->getActors()[j] );
						g_multipleView->m_nx->gControllers->reportSceneChanged();
						m_instanceGeo->m_hasPhysX = CFalse;
						Cpy( m_instanceGeo->m_physXName, "\n" );
					}
				}
			}
		}
	}
	//while(!m_cfxMaterials.empty())
	//{
		//std::map<std::string, cfxMaterial*>::iterator iter = m_cfxMaterials.begin();
		//CDelete(iter->second);
		//m_cfxMaterials.erase(iter);
	//}
	//m_cfxEffects.clear();

	//while(!m_cfxEffects.empty())
	//{
		//std::map<std::string, cfxEffect*>::iterator iter = m_cfxEffects.begin();
		//CDelete(iter->second);
		//m_cfxEffects.erase(iter);
	//}
	//m_cfxEffects.clear();
	//delete all the geometries
	m_textureList.clear(); //save functions
	m_prefabList.clear(); //save functions

	if (g_editorMode == eMODE_PREFAB)
	{
		while (!m_geometries.empty())
		{
			CDelete(m_geometries[0]);
			m_geometries.erase(m_geometries.begin());
		}
		m_geometries.clear();
	}

	m_instanceGeometries.clear();
	//m_instanceControllers.clear();
	while(!m_lightInstances.empty())
	{
		CDelete(m_lightInstances[0]);
		m_lightInstances.erase(m_lightInstances.begin());
	}
	while(!m_lights.empty())
	{
		CDelete( m_lights[0] ); 
		m_lights.erase(m_lights.begin());
	}
	while(!m_cameraInstances.empty())
	{
		for( CUInt size = 0; size < g_cameraInstances.size(); size++ )
		{
			if( Cmp( m_cameraInstances[0]->m_abstractCamera->GetName(), g_cameraInstances[size]->m_abstractCamera->GetName() ) )
			{
				if( g_render.GetActiveInstanceCamera() == g_cameraInstances[size] )
				{
					if (g_multipleView && g_render.GetDefaultInstanceCamera())
					{
						g_render.SetActiveInstanceCamera(g_render.GetDefaultInstanceCamera());
						g_currentCameraType = eCAMERA_DEFAULT_FREE;
						g_multipleView->m_lockInput = CFalse;
					}
					else
					{
						g_render.SetActiveInstanceCamera(NULL);
					}

				}
				g_cameraInstances.erase( g_cameraInstances.begin() + size );
//.........这里部分代码省略.........
开发者ID:DCubix,项目名称:1.4.0,代码行数:101,代码来源:Scene.cpp


注:本文中的NxScene类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。