Skip to content

Commit 232227c

Browse files
author
Cry-Build
committed
Merge remote-tracking branch 'public/release_candidate' into release
2 parents 667fe7e + d12a749 commit 232227c

File tree

57 files changed

+1180
-536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1180
-536
lines changed

Code/CryEngine/Cry3DEngine/3dEngine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ class C3DEngine : public I3DEngine, public Cry3DEngineBase
10321032
IStatObj* CreateStatObj();
10331033
virtual IStatObj* CreateStatObjOptionalIndexedMesh(bool createIndexedMesh);
10341034

1035-
IStatObj* UpdateDeformableStatObj(IGeometry* pPhysGeom, bop_meshupdate* pLastUpdate = 0, IFoliage* pSrcFoliage = 0);
1035+
IStatObj* UpdateDeformableStatObj(IGeometry* pPhysGeom, bop_meshupdate* pLastUpdate = 0, IFoliage* pSrcFoliage = 0, IMaterial* pMtlOverride = nullptr);
10361036

10371037
// Creates a new indexed mesh.
10381038
IIndexedMesh* CreateIndexedMesh();

Code/CryEngine/Cry3DEngine/StatObjPhys.cpp

Lines changed: 20 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,9 @@ static int InjectVertices(CMesh* pMesh, int nNewVtx, SMeshBoneMapping_uint8*& pB
461461
return nVtx0;
462462
}
463463

464-
IStatObj* C3DEngine::UpdateDeformableStatObj(IGeometry* pPhysGeom, bop_meshupdate* pLastUpdate, IFoliage* pSrcFoliage)
464+
IStatObj* C3DEngine::UpdateDeformableStatObj(IGeometry* pPhysGeom, bop_meshupdate* pLastUpdate, IFoliage* pSrcFoliage, IMaterial* pMtlOverride)
465465
{
466-
int i, j, j1, itri, iop, itriOrg, ivtx, ivtxNew, nTris0, nVtx0, iSubsetB = 0, nNewVtx, nNewPhysVtx, ivtxRef, bEmptyObj, ibox;
466+
int i, j, j1, itri, iop, itriOrg, ivtx, ivtxNew, nTris0, nVtx0, iSubsetB = 0, nNewVtx, nNewPhysVtx, ivtxRef, bEmptyObj, ibox, bSubtract = 1;
467467
int* pIdx2iTri, * piTri2Idx, * pSubsets, * pSubsets0, * pVtxWeld;
468468
int bHasColors[2] = { 0, 0 };
469469
vtx_idx* pIdx0, * pIdx;
@@ -522,6 +522,7 @@ IStatObj* C3DEngine::UpdateDeformableStatObj(IGeometry* pPhysGeom, bop_meshupdat
522522
(pStatObj[0] = CreateStatObj());//->AddRef();
523523
pStatObj[0]->SetFlags(STATIC_OBJECT_CLONE | STATIC_OBJECT_GENERATED);
524524
((CStatObj*)pStatObj[0])->m_bTmpIndexedMesh = true;
525+
bSubtract = 0;
525526
}
526527
else if (!(pStatObj[0]->GetFlags() & STATIC_OBJECT_CLONE))
527528
{
@@ -613,7 +614,7 @@ IStatObj* C3DEngine::UpdateDeformableStatObj(IGeometry* pPhysGeom, bop_meshupdat
613614
for (i = 0; i < (int)pMesh[0]->m_subsets.size(); i++)
614615
for (j = pMesh[0]->m_subsets[i].nFirstIndexId / 3; j*3 < pMesh[0]->m_subsets[i].nFirstIndexId + pMesh[0]->m_subsets[i].nNumIndices; j++)
615616
pSubsets[j] = i + (0x1000 & ~-iszero(pMesh[0]->m_subsets[i].nPhysicalizeType - PHYS_GEOM_TYPE_DEFAULT));
616-
pMaterial[0] = pStatObj[0]->GetMaterial();
617+
pMaterial[0] = pMtlOverride ? pMtlOverride : pStatObj[0]->GetMaterial();
617618

618619
for (pmu = pmu0; pmu; pmu = pmu->next)
619620
{
@@ -876,7 +877,7 @@ IStatObj* C3DEngine::UpdateDeformableStatObj(IGeometry* pPhysGeom, bop_meshupdat
876877
pmu->pNewVtx[ivtxNew].idxTri[iop] = -(ivtx + 1);
877878

878879
Quat qrot = Quat(IDENTITY) * (1.0f - iop) + pmu->relRot * (float)iop;
879-
int flip = 1 - (iop & isneg(-pmu->relScale)) * 2;
880+
int flip = 1 - (iop & bSubtract & isneg(-pmu->relScale)) * 2;
880881

881882
pTexCoord[0][ivtx] = SMeshTexCoord(Coord);
882883
pTangents[0][ivtx] = SMeshTangents(qrot * Tangent, qrot * Bitangent, NormalFlip * (int16)flip);
@@ -1460,7 +1461,7 @@ static inline float qmax(float op1, float op2) { return (op1 + op2 + fabsf(op1 -
14601461

14611462
static int __s_pvtx_map_dummy = 0;
14621463

1463-
void SyncToRenderMesh(SSyncToRenderMeshContext* ctx, volatile int* updateState)
1464+
void SyncToRenderMesh(SSyncToRenderMeshContext* ctx)
14641465
{
14651466
IGeometry* pPhysGeom = ctx->pObj->GetPhysGeom() ? ctx->pObj->GetPhysGeom()->pGeom : 0;
14661467
if (pPhysGeom)
@@ -1469,14 +1470,7 @@ void SyncToRenderMesh(SSyncToRenderMeshContext* ctx, volatile int* updateState)
14691470
IStatObj* pObjSrc = (IStatObj*)pPhysGeom->GetForeignData(0);
14701471
if (pPhysGeom->GetForeignData(DATA_MESHUPDATE) || !ctx->pObj->m_hasClothTangentsData || pObjSrc != ctx->pObj && pObjSrc != ctx->pObj->GetCloneSourceObject())
14711472
{
1472-
// skip all updates if the mesh was altered
1473-
if (updateState)
1474-
CryInterlockedDecrement(updateState);
14751473
pPhysGeom->Unlock(0);
1476-
1477-
if (ctx->pObj->m_hasClothTangentsData && ctx->pObj->m_pClothTangentsData)
1478-
ctx->mesh->UnlockStream(VSF_TANGENTS);
1479-
ctx->mesh->UnlockStream(VSF_GENERAL);
14801474
return;
14811475
}
14821476
}
@@ -1487,9 +1481,13 @@ void SyncToRenderMesh(SSyncToRenderMeshContext* ctx, volatile int* updateState)
14871481
strided_pointer<Vec3> pVtx = ctx->pVtx;
14881482
int* pVtxMap = (mask == ~0) ? &__s_pvtx_map_dummy : ctx->pVtxMap;
14891483
float rscale = ctx->rscale;
1484+
ctx->mesh->LockForThreadAccess();
14901485
SClothTangentVtx* ctd = ctx->ctd;
1491-
strided_pointer<Vec3> pMeshVtx = ctx->pMeshVtx;
1492-
strided_pointer<SPipTangents> pTangents = ctx->pTangents;
1486+
strided_pointer<Vec3> pMeshVtx;
1487+
pMeshVtx.data = (Vec3*)ctx->mesh->GetPosPtr(pMeshVtx.iStride, FSL_SYSTEM_UPDATE);
1488+
strided_pointer<SPipTangents> pTangents;
1489+
if (ctx->pObj->m_hasClothTangentsData && ctx->pObj->m_pClothTangentsData)
1490+
pTangents.data = (SPipTangents*)ctx->mesh->GetTangentPtr(pTangents.iStride, FSL_SYSTEM_UPDATE);
14931491
strided_pointer<Vec3> pNormals = ctx->pNormals;
14941492

14951493
AABB bbox;
@@ -1532,24 +1530,23 @@ void SyncToRenderMesh(SSyncToRenderMeshContext* ctx, volatile int* updateState)
15321530
}
15331531
}
15341532

1535-
if (updateState)
1536-
CryInterlockedDecrement(updateState);
15371533
if (pPhysGeom)
15381534
pPhysGeom->Unlock(0);
15391535

15401536
if (ctx->pObj->m_hasClothTangentsData && ctx->pObj->m_pClothTangentsData)
15411537
ctx->mesh->UnlockStream(VSF_TANGENTS);
15421538
ctx->mesh->UnlockStream(VSF_GENERAL);
1539+
ctx->mesh->UnLockForThreadAccess();
15431540
}
15441541

15451542
DECLARE_JOB(
15461543
"StatObj_SyncToRenderMesh"
15471544
, TStatObj_SyncToRenderMesh
15481545
, SyncToRenderMesh);
15491546

1550-
void SkinVertices(SSyncToRenderMeshContext* ctx, volatile int* ready)
1547+
void SkinVertices(SSyncToRenderMeshContext* ctx)
15511548
{
1552-
ctx->pObj->SkinVertices(ctx->pVtx, Matrix34(IDENTITY), ready);
1549+
ctx->pObj->SkinVertices(ctx->pVtx, Matrix34(IDENTITY));
15531550
}
15541551

15551552
DECLARE_JOB(
@@ -1562,8 +1559,6 @@ IStatObj* CStatObj::UpdateVertices(strided_pointer<Vec3> pVtx, strided_pointer<V
15621559
CStatObj* pObj = this;
15631560
if (m_pRenderMesh)
15641561
{
1565-
strided_pointer<Vec3> pMeshVtx;
1566-
strided_pointer<SPipTangents> pTangents;
15671562
int i, j, mask = 0, dummy = 0, nVtxFull;
15681563
if (!pVtxMap)
15691564
pVtxMap = &dummy, mask = ~0;
@@ -1580,6 +1575,7 @@ IStatObj* CStatObj::UpdateVertices(strided_pointer<Vec3> pVtx, strided_pointer<V
15801575
memset(m_pClothTangentsData, 0, sizeof(SClothTangentVtx) * nVtxFull);
15811576
mesh_data* pmd = (mesh_data*)GetPhysGeom()->pGeom->GetData();
15821577
m_pRenderMesh->LockForThreadAccess();
1578+
strided_pointer<SPipTangents> pTangents;
15831579
pTangents.data = (SPipTangents*)m_pRenderMesh->GetTangentPtr(pTangents.iStride, FSL_READ);
15841580
for (i = 0; i < pmd->nTris; i++)
15851581
for (j = 0; j < 3; j++)
@@ -1665,11 +1661,9 @@ IStatObj* CStatObj::UpdateVertices(strided_pointer<Vec3> pVtx, strided_pointer<V
16651661
{
16661662
if (GetCVars()->e_RenderMeshUpdateAsync)
16671663
{
1668-
IRenderMesh* mesh = pObj->m_pRenderMesh;
1669-
mesh->LockForThreadAccess();
16701664
m_pAsyncUpdateContext->pObj = pObj;
16711665
m_pAsyncUpdateContext->pVtx = pVtx;
1672-
TStatObj_SkinVertices job(m_pAsyncUpdateContext, mesh->SetAsyncUpdateState());
1666+
TStatObj_SkinVertices job(m_pAsyncUpdateContext);
16731667
job.RegisterJobState(&m_pAsyncUpdateContext->jobState);
16741668
job.Run();
16751669
}
@@ -1684,29 +1678,19 @@ IStatObj* CStatObj::UpdateVertices(strided_pointer<Vec3> pVtx, strided_pointer<V
16841678
if (!pVtx)
16851679
return pObj;
16861680

1687-
IRenderMesh* mesh = pObj->m_pRenderMesh;
1688-
mesh->LockForThreadAccess();
1689-
pMeshVtx.data = (Vec3*)((mesh = pObj->m_pRenderMesh)->GetPosPtr(pMeshVtx.iStride, FSL_SYSTEM_UPDATE));
1690-
if (m_hasClothTangentsData && m_pClothTangentsData)
1691-
{
1692-
pTangents.data = (SPipTangents*)mesh->GetTangentPtr(pTangents.iStride, FSL_SYSTEM_UPDATE);
1693-
}
1694-
16951681
m_pAsyncUpdateContext->Set(&pObj->m_AABB.min, &pObj->m_AABB.max, iVtx0, nVtx, pVtx, pVtxMap, mask, rscale
1696-
, m_pClothTangentsData, pMeshVtx, pTangents, pNormals, pObj, mesh);
1682+
, m_pClothTangentsData, nullptr, nullptr, pNormals, pObj, pObj->m_pRenderMesh);
16971683

16981684
if (GetCVars()->e_RenderMeshUpdateAsync)
16991685
{
1700-
TStatObj_SyncToRenderMesh job(m_pAsyncUpdateContext, mesh->SetAsyncUpdateState());
1686+
TStatObj_SyncToRenderMesh job(m_pAsyncUpdateContext);
17011687
job.RegisterJobState(&m_pAsyncUpdateContext->jobState);
17021688
job.Run();
17031689
}
17041690
else
17051691
{
1706-
SyncToRenderMesh(m_pAsyncUpdateContext, NULL);
1692+
SyncToRenderMesh(m_pAsyncUpdateContext);
17071693
}
1708-
1709-
mesh->UnLockForThreadAccess();
17101694
}
17111695
return pObj;
17121696
}

Code/CryEngine/CryAction/ILevelSystem.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ struct ILevelInfo
8989
{
9090
virtual ~ILevelInfo(){}
9191

92-
typedef struct
92+
struct SGameTypeInfo
9393
{
9494
string name;
9595
string xmlFile;
@@ -99,7 +99,7 @@ struct ILevelInfo
9999
pSizer->AddObject(name);
100100
pSizer->AddObject(xmlFile);
101101
}
102-
} TGameTypeInfo;
102+
};
103103

104104
struct SMinimapInfo
105105
{
@@ -129,9 +129,9 @@ struct ILevelInfo
129129
virtual const uint32 GetLevelTag() const = 0;
130130

131131
virtual int GetGameTypeCount() const = 0;
132-
virtual const ILevelInfo::TGameTypeInfo* GetGameType(int gameType) const = 0;
132+
virtual const ILevelInfo::SGameTypeInfo* GetGameType(int gameType) const = 0;
133133
virtual bool SupportsGameType(const char* gameTypeName) const = 0;
134-
virtual const ILevelInfo::TGameTypeInfo* GetDefaultGameType() const = 0;
134+
virtual const ILevelInfo::SGameTypeInfo* GetDefaultGameType() const = 0;
135135
virtual size_t GetGameRulesCount() const = 0;
136136
virtual size_t GetGameRules(const char** pszGameRules, size_t numGameRules) const = 0;
137137
virtual bool HasGameRules() const = 0;

Code/CryEngine/CryAction/LevelSystem.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ bool CLevelInfo::ReadInfo()
721721

722722
if (gameTypeName)
723723
{
724-
ILevelInfo::TGameTypeInfo info;
724+
ILevelInfo::SGameTypeInfo info;
725725

726726
info.cgfCount = 0;
727727
gameTypeNode->getAttr("CGFCount", info.cgfCount);
@@ -855,7 +855,7 @@ void CLevelInfo::ReadMetaData()
855855
}
856856

857857
//------------------------------------------------------------------------
858-
const ILevelInfo::TGameTypeInfo* CLevelInfo::GetDefaultGameType() const
858+
const ILevelInfo::SGameTypeInfo* CLevelInfo::GetDefaultGameType() const
859859
{
860860
if (!m_gameTypes.empty())
861861
{

Code/CryEngine/CryAction/LevelSystem.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ class CLevelInfo :
4848
virtual const bool MetadataLoaded() const override { return m_bMetaDataRead; }
4949

5050
virtual int GetGameTypeCount() const override { return m_gameTypes.size(); };
51-
virtual const ILevelInfo::TGameTypeInfo* GetGameType(int gameType) const override { return &m_gameTypes[gameType]; };
51+
virtual const ILevelInfo::SGameTypeInfo* GetGameType(int gameType) const override { return &m_gameTypes[gameType]; };
5252
virtual bool SupportsGameType(const char* gameTypeName) const override;
53-
virtual const ILevelInfo::TGameTypeInfo* GetDefaultGameType() const override;
53+
virtual const ILevelInfo::SGameTypeInfo* GetDefaultGameType() const override;
5454
virtual bool HasGameRules() const override { return !m_gamerules.empty(); }
5555

5656
virtual const ILevelInfo::SMinimapInfo& GetMinimapInfo() const override { return m_minimapInfo; }
@@ -87,7 +87,7 @@ class CLevelInfo :
8787
uint32 m_scanTag;
8888
uint32 m_levelTag;
8989
bool m_bMetaDataRead;
90-
std::vector<ILevelInfo::TGameTypeInfo> m_gameTypes;
90+
std::vector<ILevelInfo::SGameTypeInfo> m_gameTypes;
9191
bool m_isModLevel;
9292
SMinimapInfo m_minimapInfo;
9393
typedef std::map<string, TFlowInputData, stl::less_stricmp<string>> TAttributeList;

Code/CryEngine/CryAction/Network/CET_EntitySystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class CCET_RandomSystemReset final : public CCET_Base
108108
// if we're about to load a new level and throw this data away
109109
if (!m_loadingNewLevel)
110110
{
111-
const ILevelInfo::TGameTypeInfo* pGameTypeInfo = pLevel->GetDefaultGameType();
111+
const ILevelInfo::SGameTypeInfo* pGameTypeInfo = pLevel->GetDefaultGameType();
112112
const char* const szGameTypeName = pGameTypeInfo ? pGameTypeInfo->name.c_str() : "";
113113
gEnv->pAISystem->LoadLevelData(pLevel->GetPath(), szGameTypeName);
114114
}

Code/CryEngine/CryAction/Serialization/GameSerialize.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ ELoadGameResult CGameSerialize::LoadGame(CCryAction* pCryAction, const char* met
807807
CRY_ASSERT(CCryAction::GetCryAction()->StartedGameContext() == false || (pLevelInfo != 0), "Can't find level info: This might break AI");
808808
if (pLevelInfo)
809809
{
810-
const ILevelInfo::TGameTypeInfo* pGameTypeInfo = pLevelInfo->GetDefaultGameType();
810+
const ILevelInfo::SGameTypeInfo* pGameTypeInfo = pLevelInfo->GetDefaultGameType();
811811
const char* const szGameTypeName = pGameTypeInfo ? pGameTypeInfo->name.c_str() : "";
812812
if (gEnv->pAISystem)
813813
{
@@ -1530,7 +1530,7 @@ bool CGameSerialize::LoadLevel(SLoadEnvironment& loadEnv, SGameStartParams& star
15301530
CRY_ASSERT(CCryAction::GetCryAction()->StartedGameContext() == false || (pLevelInfo != 0), "Can't find level info: This might break AI");
15311531
if (pLevelInfo)
15321532
{
1533-
const ILevelInfo::TGameTypeInfo* pGameTypeInfo = pLevelInfo->GetDefaultGameType();
1533+
const ILevelInfo::SGameTypeInfo* pGameTypeInfo = pLevelInfo->GetDefaultGameType();
15341534
const char* const szGameTypeName = pGameTypeInfo ? pGameTypeInfo->name.c_str() : "";
15351535
if (gEnv->pAISystem)
15361536
{

Code/CryEngine/CryAudioSystem/implementations/CryAudioImplFmod/Impl.cpp

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,39 @@ void CImpl::UnregisterInMemoryFile(SFileInfo* const pFileInfo)
518518

519519
if (pFileData != nullptr)
520520
{
521-
CRY_VERIFY(pFileData->pBank->unload() == FMOD_OK);
521+
// Stop all playing events before unloading.
522+
int eventCount = 0;
523+
CRY_VERIFY(pFileData->pBank->getEventCount(&eventCount) == FMOD_OK, "Failed to retrieve event count during %s", __FUNCTION__);
524+
std::vector<::FMOD::Studio::EventDescription*> eventDescriptions(eventCount);
525+
526+
if (!eventDescriptions.empty())
527+
{
528+
CRY_VERIFY(pFileData->pBank->getEventList(&eventDescriptions[0], eventCount, &eventCount) == FMOD_OK, "Failed to retrieve event list during %s", __FUNCTION__);
529+
530+
for (::FMOD::Studio::EventDescription* pEventDescription : eventDescriptions)
531+
{
532+
int instanceCount = 0;
533+
CRY_VERIFY(pEventDescription->getInstanceCount(&instanceCount) == FMOD_OK, "Failed to retrieve instance count during %s", __FUNCTION__);
534+
std::vector<::FMOD::Studio::EventInstance*> eventInstances(instanceCount);
535+
536+
if (!eventInstances.empty())
537+
{
538+
CRY_VERIFY(pEventDescription->getInstanceList(&eventInstances[0], instanceCount, &instanceCount) == FMOD_OK, "Failed to retrieve instance list during %s", __FUNCTION__);
539+
540+
for (::FMOD::Studio::EventInstance* pEventInstance : eventInstances)
541+
{
542+
void* pUserData = nullptr;
543+
CRY_VERIFY(pEventInstance->getUserData(&pUserData) == FMOD_OK, "Failed to retrieve CEventInstance during %s", __FUNCTION__);
544+
CEventInstance* pCEventInstance = reinterpret_cast<CEventInstance*>(pUserData);
545+
pCEventInstance->SetToBeRemoved();
546+
}
547+
548+
CRY_VERIFY(pEventDescription->releaseAllInstances() == FMOD_OK, "Failed to release playing instances during %s", __FUNCTION__);
549+
}
550+
}
551+
}
552+
553+
CRY_VERIFY(pFileData->pBank->unload() == FMOD_OK, "Failed to unload bank \"%s\" during %s", pFileInfo->filePath, __FUNCTION__);
522554

523555
FMOD_STUDIO_LOADING_STATE loadingState;
524556

Code/CryEngine/CryCommon/Cry3DEngine/I3DEngine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2011,7 +2011,7 @@ struct I3DEngine : public IProcess
20112011

20122012
//! Updates rendering mesh in the stat obj associated with pPhysGeom.
20132013
//! \note Creates or clones the object if necessary.
2014-
virtual IStatObj* UpdateDeformableStatObj(IGeometry* pPhysGeom, bop_meshupdate* pLastUpdate = 0, IFoliage* pSrcFoliage = 0) = 0;
2014+
virtual IStatObj* UpdateDeformableStatObj(IGeometry* pPhysGeom, bop_meshupdate* pLastUpdate = 0, IFoliage* pSrcFoliage = 0, IMaterial* pMtlOverride = nullptr) = 0;
20152015

20162016
//! Saves/loads state of engine objects.
20172017
virtual void SerializeState(TSerialize ser) = 0;

Code/CryEngine/CryCommon/CryPhysics/physinterface.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ struct pe_params_car : pe_params
10441044
float kDynFriction; //!< friction modifier for sliping wheels
10451045
float steerTrackNeutralTurn; //!< for tracked vehicles, steering angle that causes equal but opposite forces on tracks
10461046
float pullTilt; //!< for tracked vehicles, tilt angle of pulling force towards ground
1047-
float maxTilt; //!< maximum wheel contact normal tilt (left or right) after which it acts as a locked part of the hull; it's a cosine of the angle
1047+
float maxTilt; //!< maximum wheel contact normal tilt (left or right) after which it acts as a locked part of the hull
10481048
int bKeepTractionWhenTilted; //!< keeps wheel traction in tilted mode
10491049
float wheelMassScale; //!< scales wheels' masses for inertia computations (default 0)
10501050
};
@@ -2448,8 +2448,8 @@ struct IGeometry
24482448
{
24492449
SProxifyParams() : ncells(50), islandMap(-1l), maxLineDot(0.88f), maxLineDist(2.0f), minLineCells(8), minSurfCells(50), surfPrimIters(1.0f), surfMinNormLen(0.5f), surfMergeDist(4.0f),
24502450
surfNormRefineThresh(0.94f), primVoxInflate(1.5f), primRefillThresh(0.6f), primVfillSurf(0.85f), primVfillLine(0.6f), primSurfOutside(0.4f), capsHRratio(4.0f), maxGeoms(128),
2451-
skipPrimMask(0), surfMeshMinCells(80), surfMeshIters(7), lenVtxNorm(1.0f), inflatePrims(0), inflateMeshes(0), nVoxPatches(0), mergeIslands(1), convexHull(0), closeHoles(0), forceBBox(0),
2452-
findPrimSurfaces(1), findPrimLines(1), findMeshes(1), surfMaxAndMinNorms(0), surfRefineWithMesh(1), storeVox(0), reuseVox(0), flipCurCell(0)
2451+
skipPrimMask(0), surfMeshMinCells(80), surfMeshIters(5), lenVtxNorm(1.0f), inflatePrims(0), inflateMeshes(0), nVoxPatches(0), mergeIslands(1), convexHull(0), closeHoles(0), forceBBox(0),
2452+
findPrimSurfaces(0), findPrimLines(0), findMeshes(1), surfMaxAndMinNorms(0), surfRefineWithMesh(0), storeVox(0), reuseVox(0), flipCurCell(0)
24532453
{ MARK_UNUSED qForced, pVoxPatches; }
24542454
int ncells;
24552455
uint64 islandMap;
@@ -2824,7 +2824,8 @@ enum rwi_flags
28242824
rwi_queue = 0x800, //!< queues the RWI request, when done it'll generate EventPhysRWIResult
28252825
rwi_force_pierceable_noncoll = 0x1000, //!< non-colliding geometries will be treated as pierceable regardless of the actual material
28262826
rwi_update_last_hit = 0x4000, //!< update phitLast with the current hit results (should be set if the last hit should be reused for a "warm" start)
2827-
rwi_any_hit = 0x8000 //!< returns the first found hit for meshes, not necessarily the closets
2827+
rwi_any_hit = 0x8000, //!< returns the first found hit for meshes, not necessarily the closets
2828+
rwi_auto_grid_start = 0x10000, //!< automatically detect the starting local grid based on the ray's origin
28282829
};
28292830
#define rwi_pierceability(pty) (pty)
28302831
#define rwi_colltype_all(colltypes) ((colltypes) << rwi_colltype_bit)
@@ -3549,7 +3550,7 @@ struct IPhysicalWorld
35493550

35503551
//! DeformPhysicalEntity - applies boolean breaking for entity parts that have >=0 breakability index
35513552
//! r is used to scale the corresponding explosion (boolean) shape
3552-
virtual int DeformPhysicalEntity(IPhysicalEntity* pent, const Vec3& ptHit, const Vec3& dirHit, float r, int flags = 0) = 0;
3553+
virtual int DeformPhysicalEntity(IPhysicalEntity* pent, const Vec3& ptHit, const Vec3& dirHit, float r, int flags = 0, const Vec3& dirUp = Vec3(ZERO)) = 0;
35533554
//! UpdateDeformingEntities - normally this happens automatically during TimeStep; can be called manually for ex. during loading
35543555
virtual void UpdateDeformingEntities(float time_interval = 0.01f) = 0; //!< normally this happens during TimeStep
35553556
//! CalculateExplosionExposure - uses occlusion grid from the last SimulateExplosion to calculate exposure

0 commit comments

Comments
 (0)