SpeedTree: read the .spt collision and composite texcoord blocks

The CSpeedTreeRT stand-in now returns the collision objects stored in
the .spt (12000 section: spheres and cylinders) instead of one fixed trunk
cylinder, and takes leaf texture rects from the 10000 section instead of
hand-picked atlas rects (trees without leaf maps use the frond rect).
SpeedGrass/BoundaryShapeManager are N_A (no 40250 caller).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-30 12:20:34 +09:00
co-authored by Claude Opus 5.5
parent 17cb7326c1
commit ed61b2d20f
8 changed files with 529 additions and 55 deletions
@@ -0,0 +1,32 @@
{
"reference": "SpeedTreeLib/BoundaryShapeManager.cpp",
"reference_sha256": "6fdfc42ca249991740567658bc0dced8dedddb387e2f4e1dcbad53b0d38fc964",
"priority": "P4",
"contracts": [],
"functions": {
"CBoundaryShapeManager::CBoundaryShapeManager": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CBoundaryShapeManager::~CBoundaryShapeManager": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CBoundaryShapeManager::LoadBsfFile": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CBoundaryShapeManager::PointInside": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CBoundaryShapeManager::PointInShape": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CBoundaryShapeManager::RandomPoint": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
}
}
}
@@ -0,0 +1,100 @@
{
"reference": "SpeedTreeLib/SpeedGrassRT.cpp",
"reference_sha256": "1fbd873c76a7aa57935035ea45a720527b9fd8ee478352806934fbb5f9c86d42",
"priority": "P4",
"contracts": [],
"functions": {
"VecInterpolate": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::SBlade::SBlade": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::SRegion::SRegion": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::CSpeedGrassRT": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::~CSpeedGrassRT": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::DeleteRegions": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::GetRegions": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::ParseBsfFile": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::CustomPlacement": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::GetLodParams": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::SetLodParams": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::Cull": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::SetWindDirection": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::GetWindDirection": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::GetCameraPos": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::SetCamera": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::SetPerspective": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::CreateRegions": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::RotateAxisFromIdentity": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::ComputeFrustum": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::ComputeUnitBillboard": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::ConvertCoordsToCell": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::OutsideFrustum": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
}
}
}
@@ -0,0 +1,36 @@
{
"reference": "SpeedTreeLib/SpeedGrassWrapper.cpp",
"reference_sha256": "c737f71f0115acabec0eb1ba4cf4a0ec9a169c8ac5f9ac32a789d2194ac00f53",
"priority": "P4",
"contracts": [],
"functions": {
"CSpeedGrassWrapper::CSpeedGrassWrapper": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassWrapper::~CSpeedGrassWrapper": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassWrapper::Draw": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassWrapper::InitFromBsfFile": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassWrapper::Color": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassWrapper::Height": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassWrapper::InitGraphics": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
}
}
}
@@ -68,7 +68,8 @@
"impl": [
"src/port/SpeedTreeLib/SpeedTreeWrapper.cpp:CSpeedTreeWrapper::SetupLeafBuffers"
],
"note": "verbatim. DIVERGENT input: the stand-in's leaf clusters and composite-atlas rects are hand-picked (the .spt stores no per-leaf-map texcoords: leaf entries 0x0FA0-0x0FA7 carry colour/path/origin/size only, and the single 8-float 0x4E25 rect in the 0x4E20 composite block, one per file for 1-3 leaf maps, frames the billboard cell in most atlases; billboards never render in 40250 since SetLodLevel(1.0)); NEEDS_LIVE"
"note": "verbatim. Leaf texture coordinates are the .spt composite-atlas rects (10000 section: 10002 leaf maps, 10003 frond map, 10004 billboard, 8 floats per card, v flipped under SetTextureFlip), replacing the hand-picked rects; a tree without leaf maps (palms, ferns, bare winter trees) draws the proxy clusters with its frond rect. DIVERGENT input remains: cluster positions/sizes are the stand-in's procedural proxy, not the closed engine's; NEEDS_LIVE",
"test": "tests/port/port_speedtree_test.cpp"
},
"CSpeedTreeWrapper::Advance": {
"status": "PORTED",
@@ -196,18 +197,20 @@
]
},
"CSpeedTreeWrapper::GetCollisionObjectCount": {
"status": "DIVERGENT",
"status": "PORTED",
"impl": [
"src/port/SpeedTreeLib/SpeedTreeWrapper.cpp:CSpeedTreeWrapper::GetCollisionObjectCount"
],
"note": "verbatim; the stand-in returns one trunk CO_CYLINDER (radius 35, height 750), not the .spt collision objects"
"note": "verbatim; the CSpeedTreeRT stand-in returns the .spt collision block as stored (12000 section: 12002 sphere x y z r, 12003 cylinder x y z r h; 1-5 objects, none for aloe/fern ground plants, checked on all 118 pack .spt); the wrapper passes no size override (LoadTree fSize -1), so no SetTreeSize rescale applies",
"test": "tests/port/port_speedtree_test.cpp"
},
"CSpeedTreeWrapper::GetCollisionObject": {
"status": "DIVERGENT",
"status": "PORTED",
"impl": [
"src/port/SpeedTreeLib/SpeedTreeWrapper.cpp:CSpeedTreeWrapper::GetCollisionObject"
],
"note": "verbatim; the stand-in returns one trunk CO_CYLINDER (radius 35, height 750), not the .spt collision objects"
"note": "verbatim; the CSpeedTreeRT stand-in returns the .spt collision block as stored (12000 section: 12002 sphere x y z r, 12003 cylinder x y z r h; 1-5 objects, none for aloe/fern ground plants, checked on all 118 pack .spt); the wrapper passes no size override (LoadTree fSize -1), so no SetTreeSize rescale applies",
"test": "tests/port/port_speedtree_test.cpp"
},
"CSpeedTreeWrapper::GetPosition": {
"status": "PORTED",