PVS related imps

This commit is contained in:
Phillip Stephens 2023-10-24 09:24:51 -07:00
parent a9c152e3e6
commit 147cd11849
10 changed files with 104 additions and 29 deletions

View File

@ -8462,7 +8462,7 @@ SphereSubdivideCollision__26CJointCollisionDescriptionF6CSegId6CSegIdffQ226CJoin
SphereCollision__26CJointCollisionDescriptionF6CSegIdfRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>f = .text:0x801A880C; // type:function size:0xC0 scope:global
__dt__15CCollisionActorFv = .text:0x801A88CC; // type:function size:0xE8 scope:global
fn_801A89B4 = .text:0x801A89B4; // type:function size:0x58
fn_801A8A0C = .text:0x801A8A0C; // type:function size:0x10C
__dt__32CCollidableOBBTreeGroupContainerFv = .text:0x801A8A0C; // type:function size:0x10C
GetCollisionResponseType__15CCollisionActorCFRC9CVector3fRC9CVector3fRC11CWeaponModei = .text:0x801A8B18; // type:function size:0x8 scope:global
fn_801A8B20 = .text:0x801A8B20; // type:function size:0x5C
GetSphereRadius__15CCollisionActorCFv = .text:0x801A8B7C; // type:function size:0x8 scope:global
@ -11737,14 +11737,14 @@ __ct__23CCollidableOBBTreeGroupFP32CCollidableOBBTreeGroupContainerRC13CMaterial
GetType__23CCollidableOBBTreeGroupFv = .text:0x802AD9B4; // type:function size:0x1C scope:global
SetStaticTableIndex__23CCollidableOBBTreeGroupFUi = .text:0x802AD9D0; // type:function size:0x8 scope:global
__ct__23CCollidableOBBTreeGroupFRC9CVector3fRC9CVector3f = .text:0x802AD9D8; // type:function size:0x27C scope:global
__ct__23CCollidableOBBTreeGroupFR12CInputStream = .text:0x802ADC54; // type:function size:0x29C scope:global
__ct__32CCollidableOBBTreeGroupContainerFR12CInputStream = .text:0x802ADC54; // type:function size:0x29C scope:global
FCollidableOBBTreeGroupFactory__FRC10SObjectTagR12CInputStreamRC15CVParamTransfer = .text:0x802ADEF0; // type:function size:0x68 scope:global
__ct<23CCollidableOBBTreeGroup>__16CFactoryFnReturnFP23CCollidableOBBTreeGroup = .text:0x802ADF58; // type:function size:0xA4 scope:global
__dt__51TObjOwnerDerivedFromIObj<23CCollidableOBBTreeGroup>Fv = .text:0x802ADFFC; // type:function size:0x90 scope:global
GetIObjObjectFor__33TToken<23CCollidableOBBTreeGroup>FRCQ24rstl35auto_ptr<23CCollidableOBBTreeGroup> = .text:0x802AE08C; // type:function size:0x2C scope:global
GetNewDerivedObject__51TObjOwnerDerivedFromIObj<23CCollidableOBBTreeGroup>FRCQ24rstl35auto_ptr<23CCollidableOBBTreeGroup> = .text:0x802AE0B8; // type:function size:0x9C scope:global
fn_802AE154 = .text:0x802AE154; // type:function size:0x64
reserve__Q24rstl44vector<8COBBTree,Q24rstl17rmemory_allocator>Fi = .text:0x802AE1B8; // type:function size:0x110 scope:global
__ct<32CCollidableOBBTreeGroupContainer>__16CFactoryFnReturnFP32CCollidableOBBTreeGroupContainer = .text:0x802ADF58; // type:function size:0xA4 scope:global
__dt__60TObjOwnerDerivedFromIObj<32CCollidableOBBTreeGroupContainer>Fv = .text:0x802ADFFC; // type:function size:0x90 scope:global
GetIObjObjectFor__42TToken<32CCollidableOBBTreeGroupContainer>FRCQ24rstl44auto_ptr<32CCollidableOBBTreeGroupContainer> = .text:0x802AE08C; // type:function size:0x2C scope:global
GetNewDerivedObject__60TObjOwnerDerivedFromIObj<32CCollidableOBBTreeGroupContainer>FRCQ24rstl44auto_ptr<32CCollidableOBBTreeGroupContainer> = .text:0x802AE0B8; // type:function size:0x9C scope:global
__dt__Q24rstl44auto_ptr<32CCollidableOBBTreeGroupContainer>Fv = .text:0x802AE154; // type:function size:0x64
reserve__Q24rstl63vector<Q24rstl19auto_ptr<8COBBTree>,Q24rstl17rmemory_allocator>Fi = .text:0x802AE1B8; // type:function size:0x110 scope:global
reserve__Q24rstl42vector<6CAABox,Q24rstl17rmemory_allocator>Fi = .text:0x802AE2C8; // type:function size:0x11C scope:global
GetEntityIdByIndex__11CPVSAreaSetCFUi = .text:0x802AE3E4; // type:function size:0x10 scope:global
GetLightSet__11CPVSAreaSetCFi = .text:0x802AE3F4; // type:function size:0x90 scope:global
@ -18621,7 +18621,7 @@ lbl_803EC428 = .data:0x803EC428; // type:object size:0x10
lbl_803EC438 = .data:0x803EC438; // type:object size:0x10
lbl_803EC448 = .data:0x803EC448; // type:object size:0x28
__vt__23CCollidableOBBTreeGroup = .data:0x803EC470; // type:object size:0x28 scope:global
lbl_803EC498 = .data:0x803EC498; // type:object size:0x10
__vt__60TObjOwnerDerivedFromIObj<32CCollidableOBBTreeGroupContainer> = .data:0x803EC498; // type:object size:0x10
jumptable_803EC4A8 = .data:0x803EC4A8; // type:object size:0x20 scope:local
lbl_803EC4C8 = .data:0x803EC4C8; // type:object size:0x20
lbl_803EC4E8 = .data:0x803EC4E8; // type:object size:0x20

View File

@ -8467,7 +8467,7 @@ SphereSubdivideCollision__26CJointCollisionDescriptionF6CSegId6CSegIdffQ226CJoin
SphereCollision__26CJointCollisionDescriptionF6CSegIdfRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>f = .text:0x801A8888; // type:function size:0xC0 scope:global
__dt__15CCollisionActorFv = .text:0x801A8948; // type:function size:0xE8 scope:global
fn_801A89B4 = .text:0x801A8A30; // type:function size:0x58 scope:global
fn_801A8A0C = .text:0x801A8A88; // type:function size:0x10C scope:global
__dt__32CCollidableOBBTreeGroupContainerFv = .text:0x801A8A88; // type:function size:0x10C scope:global
GetCollisionResponseType__15CCollisionActorCFRC9CVector3fRC9CVector3fRC11CWeaponModei = .text:0x801A8B94; // type:function size:0x8 scope:global
fn_801A8B20 = .text:0x801A8B9C; // type:function size:0x5C scope:global
GetSphereRadius__15CCollisionActorCFv = .text:0x801A8BF8; // type:function size:0x8 scope:global
@ -11750,14 +11750,14 @@ __ct__23CCollidableOBBTreeGroupFP32CCollidableOBBTreeGroupContainerRC13CMaterial
GetType__23CCollidableOBBTreeGroupFv = .text:0x802ADA60; // type:function size:0x1C scope:global
SetStaticTableIndex__23CCollidableOBBTreeGroupFUi = .text:0x802ADA7C; // type:function size:0x8 scope:global
__ct__23CCollidableOBBTreeGroupFRC9CVector3fRC9CVector3f = .text:0x802ADA84; // type:function size:0x27C scope:global
__ct__23CCollidableOBBTreeGroupFR12CInputStream = .text:0x802ADD00; // type:function size:0x29C scope:global
__ct__32CCollidableOBBTreeGroupContainerFR12CInputStream = .text:0x802ADD00; // type:function size:0x29C scope:global
FCollidableOBBTreeGroupFactory__FRC10SObjectTagR12CInputStreamRC15CVParamTransfer = .text:0x802ADF9C; // type:function size:0x68 scope:global
__ct<23CCollidableOBBTreeGroup>__16CFactoryFnReturnFP23CCollidableOBBTreeGroup = .text:0x802AE004; // type:function size:0xA4 scope:global
__dt__51TObjOwnerDerivedFromIObj<23CCollidableOBBTreeGroup>Fv = .text:0x802AE0A8; // type:function size:0x90 scope:global
GetIObjObjectFor__33TToken<23CCollidableOBBTreeGroup>FRCQ24rstl35auto_ptr<23CCollidableOBBTreeGroup> = .text:0x802AE138; // type:function size:0x2C scope:global
GetNewDerivedObject__51TObjOwnerDerivedFromIObj<23CCollidableOBBTreeGroup>FRCQ24rstl35auto_ptr<23CCollidableOBBTreeGroup> = .text:0x802AE164; // type:function size:0x9C scope:global
fn_802AE154 = .text:0x802AE200; // type:function size:0x64 scope:global
reserve__Q24rstl44vector<8COBBTree,Q24rstl17rmemory_allocator>Fi = .text:0x802AE264; // type:function size:0x110 scope:global
__ct<32CCollidableOBBTreeGroupContainer>__16CFactoryFnReturnFP32CCollidableOBBTreeGroupContainer = .text:0x802AE004; // type:function size:0xA4 scope:global
__dt__60TObjOwnerDerivedFromIObj<32CCollidableOBBTreeGroupContainer>Fv = .text:0x802AE0A8; // type:function size:0x90 scope:global
GetIObjObjectFor__42TToken<32CCollidableOBBTreeGroupContainer>FRCQ24rstl44auto_ptr<32CCollidableOBBTreeGroupContainer> = .text:0x802AE138; // type:function size:0x2C scope:global
GetNewDerivedObject__60TObjOwnerDerivedFromIObj<32CCollidableOBBTreeGroupContainer>FRCQ24rstl44auto_ptr<32CCollidableOBBTreeGroupContainer> = .text:0x802AE164; // type:function size:0x9C scope:global
__dt__Q24rstl44auto_ptr<32CCollidableOBBTreeGroupContainer>Fv = .text:0x802AE200; // type:function size:0x64 scope:global
reserve__Q24rstl63vector<Q24rstl19auto_ptr<8COBBTree>,Q24rstl17rmemory_allocator>Fi = .text:0x802AE264; // type:function size:0x110 scope:global
reserve__Q24rstl42vector<6CAABox,Q24rstl17rmemory_allocator>Fi = .text:0x802AE374; // type:function size:0x11C scope:global
GetEntityIdByIndex__11CPVSAreaSetCFUi = .text:0x802AE490; // type:function size:0x10 scope:global
GetLightSet__11CPVSAreaSetCFi = .text:0x802AE4A0; // type:function size:0x90 scope:global
@ -18672,7 +18672,7 @@ lbl_803EC428 = .data:0x803EC608; // type:object size:0x10 scope:global
lbl_803EC438 = .data:0x803EC618; // type:object size:0x10 scope:global
lbl_803EC448 = .data:0x803EC628; // type:object size:0x28 scope:global
__vt__23CCollidableOBBTreeGroup = .data:0x803EC650; // type:object size:0x28 scope:global
lbl_803EC498 = .data:0x803EC678; // type:object size:0x10 scope:global
__vt__60TObjOwnerDerivedFromIObj<32CCollidableOBBTreeGroupContainer> = .data:0x803EC678; // type:object size:0x10 scope:global
lbl_803EC4A8 = .data:0x803EC688; // type:object size:0x20 scope:global
lbl_803EC4C8 = .data:0x803EC6A8; // type:object size:0x20 scope:global
lbl_803EC4E8 = .data:0x803EC6C8; // type:object size:0x20 scope:global

View File

@ -9,6 +9,8 @@ class CPVSVisOctree {
public:
int IterateSearch(uchar a, const CVector3f& pos) const;
uint GetNumChildren(uchar a) const;
uint GetNumObjects() const { return mNumObjects; }
uint GetNumLights() const { return mNumLights; }
static CPVSVisOctree MakePVSVisOctree(const char* data, int len);

View File

@ -6,7 +6,7 @@
class CPVSVisSet {
public:
static CPVSVisSet Reset(int);
void SetFromMemory(int numBits, int numLights, const char* leafPtr);
private:
int x0_state;
uint x4_numBits;

View File

@ -0,0 +1,19 @@
#ifndef _CCOLLIDABLEOBBTREE
#define _CCOLLIDABLEOBBTREE
#include <Collision/CCollisionPrimitive.hpp>
class COBBTree;
class CCollidableOBBTree : public CCollisionPrimitive {
public:
CCollidableOBBTree(const COBBTree& tree, const CMaterialList& list);
uint GetTableIndex() const override;
CAABox CalculateAABox(const CTransform4f& xf) const override;
const CAABox CalculateLocalAABox() const override;
FourCC GetPrimType() const override;
CRayCastResult CastRayInternal(const CInternalRayCastStructure& intRayCast) const override;
};
#endif // _CCOLLIDABLEOBBTREE

View File

@ -11,14 +11,15 @@
class COBBTree;
class CCollidableOBBTreeGroupContainer {
public:
CCollidableOBBTreeGroupContainer(CInputStream& in);
CCollidableOBBTreeGroupContainer(const CVector3f&, const CVector3f&);
private:
friend class CCollidableOBBTreeGroup;
rstl::vector< rstl::auto_ptr< COBBTree > > x0_trees;
rstl::vector< CAABox > x10_aabbs;
CAABox x20_aabox;
public:
CCollidableOBBTreeGroupContainer(CInputStream& in);
CCollidableOBBTreeGroupContainer(const CVector3f&, const CVector3f&);
};
class CCollidableOBBTreeGroup : public CCollisionPrimitive {
@ -33,6 +34,8 @@ public:
~CCollidableOBBTreeGroup() override {}
CRayCastResult CastRayInternal(const CInternalRayCastStructure&) const override;
static Type GetType();
static void SetStaticTableIndex(uint);
private:
CCollidableOBBTreeGroupContainer* x10_container;
};

View File

@ -20,6 +20,12 @@ class COBBTree {
rstl::vector<CVector3f> x60_vertices;
SIndexData(CInputStream& in);
};
public:
COBBTree(CInputStream& in);
~COBBTree();
private:
char data[0x8c];
};
#endif // _COBBTREE

View File

@ -22,10 +22,10 @@ private:
int x4_;
int x8_;
int xc_;
int x10_;
int x10_leafSize;
int x14_;
const char* x18_;
const char* x1c_;
const char* x1c_lightLeaves;
CPVSVisOctree x20_octree;
};

View File

@ -0,0 +1,38 @@
#include "Collision/CCollisionPrimitive.hpp"
#include <WorldFormat/CCollidableOBBTreeGroup.hpp>
#include <WorldFormat/CCollidableOBBTree.hpp>
#include <WorldFormat/COBBTree.hpp>
#include <Kyoto/CFactoryMgr.hpp>
#pragma inline_max_size(250)
CFactoryFnReturn FCollidableOBBTreeGroupFactory(const SObjectTag& tag, CInputStream& in,
const CVParamTransfer& xfer) {
return rs_new CCollidableOBBTreeGroupContainer(in);
}
CCollidableOBBTreeGroupContainer::CCollidableOBBTreeGroupContainer(CInputStream& in)
: x20_aabox(CAABox::MakeMaxInvertedBox()) {
int obbCount = in.ReadInt32();
x0_trees.reserve(obbCount);
for (uint i = 0; i < obbCount; ++i) {
x0_trees.push_back(rs_new COBBTree(in));
}
x10_aabbs.reserve(x0_trees.size());
rstl::vector< rstl::auto_ptr< COBBTree > >::iterator it = x0_trees.begin();
for (; it != x0_trees.end(); ++it) {
CCollidableOBBTree tree(*it->get(), CMaterialList());
CAABox box = tree.CalculateLocalAABox();
x10_aabbs.push_back(box);
x20_aabox.AccumulateBounds(box.GetMinPoint());
x20_aabox.AccumulateBounds(box.GetMaxPoint());
}
}
CCollisionPrimitive::Type CCollidableOBBTreeGroup::GetType() {
return Type(SetStaticTableIndex, "CCollidableOBBTreeGroup");
}

View File

@ -1,8 +1,8 @@
#include "Kyoto/PVS/CPVSVisOctree.hpp"
#include "rstl/auto_ptr.hpp"
#include <WorldFormat/CPVSAreaSet.hpp>
#include <Kyoto/PVS/CPVSVisSet.hpp>
#include <Kyoto/Streams/CMemoryInStream.hpp>
#include <WorldFormat/CPVSAreaSet.hpp>
#pragma inline_max_size(250)
CPVSAreaSet::CPVSAreaSet(int numFeatures, int numLights, int num2ndLights, int numActors,
@ -12,10 +12,10 @@ CPVSAreaSet::CPVSAreaSet(int numFeatures, int numLights, int num2ndLights, int n
, x4_(numLights)
, x8_(num2ndLights)
, xc_(numActors)
, x10_(leafSize)
, x10_leafSize(leafSize)
, x14_(lightIndexCount)
, x18_(w7)
, x1c_(w8)
, x1c_lightLeaves(w8)
, x20_octree(CPVSVisOctree::MakePVSVisOctree(w9, 68)) {}
rstl::auto_ptr< CPVSAreaSet > CPVSAreaSet::MakeAreaSet(const char* data, int len) {
@ -35,3 +35,10 @@ rstl::auto_ptr< CPVSAreaSet > CPVSAreaSet::MakeAreaSet(const char* data, int len
}
const CPVSVisOctree& CPVSAreaSet::GetVisOctree(const uint) const { return x20_octree; }
CPVSVisSet CPVSAreaSet::GetLightSet(int lightIdx) const {
CPVSVisSet ret;
ret.SetFromMemory(x20_octree.GetNumObjects(), x20_octree.GetNumLights(),
x1c_lightLeaves + x10_leafSize * lightIdx);
return ret;
}