Parameters |
Description |
bOcean |
True to activate the ocean rendering, false to deactivate it. |
Syntax: System.EnableOceanRendering()
Enables/disables ocean rendering.
int CScriptBindSystem::IndoorSoundAllowed(IFunctionHandler * pH) { SCRIPT_CHECK_PARAMETERS(2); CScriptVector pVecOrigin(m_pSS,false); CScriptVector pVecDestination(m_pSS,false);
IGraph *pGraph = gEnv->pAISystem->GetNodeGraph();
Vec3 start = pVecOrigin.Get(); Vec3 end = pVecDestination.Get();
if ((start.x<0)||(start.x>2000.f)||(start.y<0)||(start.y>2000.f)) { m_pLog->LogError("[CRASHWARNING] Unnaturally high value placed for sound detection"); return pH->EndFunction(true); // there is no sound occlusion in outdoor }
if ((end.x<0)||(end.x>2000.f)||(end.y<0)||(end.y>2000.f)) { m_pLog->LogError("[CRASHWARNING] Unnaturally high value placed for sound detection"); return pH->EndFunction(true); // there is no sound occlusion in outdoor }
GraphNode *pStart = pGraph->GetEnclosing(pVecOrigin.Get());
if (pStart->nBuildingID<0) return pH->EndFunction(true); // there is no sound occlusion in outdoor
GraphNode *pEnd = pGraph->GetEnclosing(pVecDestination.Get());
if (pStart->nBuildingID!=pEnd->nBuildingID) return pH->EndFunction(false); // if in 2 different buildings we cannot hear the sound for sure
// make the real indoor sound occlusion check (doors, sectors etc.) return (gEnv->p3DEngine->IsVisAreasConnected(pStart->pArea,pEnd->pArea,1,false));
//IIndoorBase *pIndoor = m_p3DEngine->GetBuildingManager(); //if (pIndoor) { // make the real indoor sound occlusion check (doors, sectors etc.) return pH->EndFunction(pIndoor->IsSoundPotentiallyHearable(pStart->nBuildingID,pStart->nSector,pEnd->nSector)); //}
return pH->EndFunction(true);
Copyright (c) 2012. All rights reserved.
|