CD Code Digest Hub /GTA V · v2

数学与容器:vectormath / vector / math、atl 容器、字符串与哈希、curve、spatialdata

44 分钟阅读 10 个章节

本页覆盖 RAGE 的“基础词汇”:两代向量数学库(SIMD 封装的 vectormath 与旧式 vector)、标量数学工具(math、mathext),atl 模板容器(数组、哈希表、二分映射、池、侵入式容器、智能指针)、字符串与哈希命名约定(atStringHash、atHashString 及其命名空间),以及 curve、spatialdata、xmldata、init(INI 解析)和 deprecated 目录。几乎所有其他页面中出现的 Vec3V、atArray、atHashString、spdAABB 都在这里定义。

背景与相关页面#

相关源码文件#

区域文件(相对 src/dev_ng/rage/base/src/)
vectormathvectormath/vectorconfig.h、vectortypes.h、vectormath.h、classes.h、scalarv.h、vec3v.h、vec4v.h、mat34v.h、classfreefuncsv.h、v4vector4v.h、v*vector4vcore_{win32pc,ps3,xbox360}.inl、*_soa.h、legacyconvert.h
vector(旧)vector/vector3.h、vector3_config.h、matrix34.h、quaternion.h、color32.h、geometry.h
math / mathextmath/amath.h、random.h、float16.h、angmath.h、vecrand.h;mathext/lcp.h、linearalgebra.h、noise.h、subspaceid.h、hilbert.h
atlatl/array.h、map.h/.cpp、binmap.h、hashstring.h/.cpp、string.h、pool.h/.cpp、bitset.h、queue.h、dlist.h、slist.h、inlist.h、inmap.h、delegate.h、functor.h、ptr.h、singleton.h、pagedpool.h、dynapool.h、staticpool.h、freelist.h
stringstring/stringhash.h/.cpp、string.h、stringheap.h、stringbuilder.h、unicode.h、city.h
其他curve/*、spatialdata/*(含 metadata.psc、grid2d.psc)、xmldata/*、init/ini.h、deprecated/*

1. vectormath:SIMD 向量库#

1.1 后端选择#

  • VECTORIZE = RSG_CPU_PPC || RSG_CPU_SPU || RSG_CPU_INTEL,USE_INTRINSICS = 1,SCALAR_TYPES_ONLY = __PSP2;三者满足时 UNIQUE_VECTORIZED_TYPE = 1,否则退化为标量结构实现(注释称适用于对齐受限的工具构建或调试) src/dev_ng/rage/base/src/vectormath/vectorconfig.h:10-40。
  • 底层寄存器类型 Vec::Vector_4V:Xenon __vector4(passinreg)、PS3/SPU AltiVec vector float、Intel __m128(Durango/Orbis 假定 SSE4.1,PC 假定 SSE2)、PSP2 NEON float32x4_t src/dev_ng/rage/base/src/vectormath/vectortypes.h:205-214、src/dev_ng/rage/base/src/vectormath/vectortypes.h:255-265、src/dev_ng/rage/base/src/vectormath/vectortypes.h:303-346。
  • 分层:vectormath.h 先声明 V1/V2/V3/V4 前缀的底层函数(V4Add、V4InvSqrt、V4Permute…),再按平台包含 v*vector4vcore_{ps3,xbox360,win32pc}.inl(平台核心实现),最后包含跨平台 .inl(基于核心函数组合)。注释约定:某函数若有平台特化的更快写法,应提升进 core 并为每个平台实现 src/dev_ng/rage/base/src/vectormath/vectormath.h:17-90、src/dev_ng/rage/base/src/vectormath/v4vector4v.h:467-884。

1.2 类型与约定#

classes.h 汇集 AoS 类型 BoolV/VecBoolV/ScalarV/Vec2V/Vec3V/Vec4V/QuatV/Mat33V/Mat34V/Mat44V/TransformV 与标量版 Vec2f/Vec3f/Vec4f/QuatF,以及自由函数 classfreefuncsf.h(标量)/classfreefuncsv.h(向量) src/dev_ng/rage/base/src/vectormath/classes.h:12-50。

约定说明证据
每个 *V 类型就是一个 Vec::Vector_4V vVec3V 的 w 分量存在但语义未定义;ScalarV 要求四分量相同(splat),IsValid() 检查是否仍为 splatsrc/dev_ng/rage/base/src/vectormath/vec3v.h:343、src/dev_ng/rage/base/src/vectormath/scalarv.h:219-264
Mat34V 为列主序,4 列 m_col0..m_col3,前 3 列通常为旋转,第 4 列为平移—src/dev_ng/rage/base/src/vectormath/mat34v.h:43-60、src/dev_ng/rage/base/src/vectormath/mat34v.h:218-223
参数类型别名 Vec3V_In/Out/InOut/RefWin32 PC 上 _In 为 const 引用,其余平台按值传寄存器(推断:与 MSVC 在 PC 上无法按值在寄存器中传递 __m128 有关,源码未注明原因);_Out 为 const 值以提醒不是按引用返回;注释建议性能敏感代码改用 Vec::V3Param128src/dev_ng/rage/base/src/vectormath/vec3v.h:15-36
常量构造 Vec3V(V_ZERO)、Mat34V(V_IDENTITY)用枚举 initializer 生成常量,避免内存加载src/dev_ng/rage/base/src/vectormath/vec3v.h:53-72
资源构造 Mat34V(datResource&) {}放置时不初始化src/dev_ng/rage/base/src/vectormath/mat34v.h:57-59
函数变体后缀 Fast(低精度估算)、Safe(除零/零长度时返回给定值)、FastSafe例如 Normalize/NormalizeSafe/NormalizeFast、InvMag/InvMagSafe/InvMagFastsrc/dev_ng/rage/base/src/vectormath/classfreefuncsv.h:644-752
比较返回 VecBoolV/BoolV,或用 IsGreaterThanAll 之类返回 unsigned int避免向量→标量寄存器往返src/dev_ng/rage/base/src/vectormath/classfreefuncsv.h:253-260

SoA 版本(Vec3V_SoA 等,*_soa.h)用四个寄存器分别存 4 个向量的 x/y/z,用于批量运算。

1.3 与旧库互转#

legacyconvert.h 提供 RCC_VEC3V/RC_SCALARV/VECTOR3_TO_VEC3V 等宏,在 Vector3↔Vec3V、Matrix34↔Mat34V、Vector4↔Vec4V 间零成本 reinterpret_cast;LEGACYCONVERT_REINTERPRETCAST_DEBUG = __DEV 时通过函数包装做编译期类型检查 src/dev_ng/rage/base/src/vectormath/legacyconvert.h:12-54、src/dev_ng/rage/base/src/vectormath/vectorconfig.h:24-27。可以零成本互转的前提是两者内存布局一致(见下)。


2. vector:旧式数学库#

  • Vector3 在 Intel 平台是 union { __m128 xyzw; struct { float x, y, z, w; }; ... },即 16 字节、带 w;Xenon/PS3/PSP2 同样以向量寄存器类型为底;纯标量回退时由 VECTORIZED_PADDING(恒为 1)保证仍含 w src/dev_ng/rage/base/src/vector/vector3.h:1855-1963、src/dev_ng/rage/base/src/vector/vector3_config.h:10-20。
  • vector3_config.h 的 VECTORIZED 只在 Xenon/PS3 为真——即 PC/PS4/XB1 上旧库不使用其 Xenon/PS3 专用的向量化路径(Intel 分支直接使用 SSE intrinsics 的 union 布局) src/dev_ng/rage/base/src/vector/vector3_config.h:10-11。
  • Matrix34 是 4 个 Vector3:a, b, c(三轴)与 d(平移),与 Mat34V 的 4 列一一对应 src/dev_ng/rage/base/src/vector/matrix34.h:1630-1638。
  • 其余:Vector2/Vector4/Matrix33/Matrix44/Quaternion、颜色 Color32/Color64/ColorVector3、大型几何工具集 geometry.h(相交/距离/求交测试)、凸包 hull.h、量化 quantize.h。

3. math 与 mathext#

组件内容证据
amath.h标量数学工具(如 SelectfHelper、编译期 CompileTimeLog2Floor 等;未逐一列举)src/dev_ng/rage/base/src/math/amath.h:182-186、src/dev_ng/rage/base/src/math/amath.h:1764
mthRandom乘法进位(MWC)随机数,两个 32 位种子;全局实例 g_ReplayRand(影响玩法、需回放一致)与 g_DrawRand(仅表现,可随视角变化)src/dev_ng/rage/base/src/math/random.h:40-66、src/dev_ng/rage/base/src/math/random.h:220-234
mthRandomMWC另一种 CMWC 生成器src/dev_ng/rage/base/src/math/random.h:166-181
Float16、Float16Vec2/4半精度浮点存储(顶点/压缩数据)src/dev_ng/rage/base/src/math/float16.h:35-140
mthVecRand向量化随机数src/dev_ng/rage/base/src/math/vecrand.h:28
mathext/lcp.hLCP 求解相关(atPriorityArray、phConstraintGraphEdge/Node),服务于物理约束src/dev_ng/rage/base/src/mathext/lcp.h:22-262
mathext/noise.hPerlinNoisesrc/dev_ng/rage/base/src/mathext/noise.h:27
mathext/subspaceid.h、hilbert.h、linearalgebra.h子空间辨识、Hilbert 曲线、线性代数辅助src/dev_ng/rage/base/src/mathext/subspaceid.h:17

4. 字符串哈希与命名约定#

4.1 哈希函数族#

全部基于 Bob Jenkins 的 one-at-a-time 哈希(逐字节 key += c; key += key<<10; key ^= key>>6,最后 atFinalizeHash:key += key<<3; key ^= key>>11; key += key<<15):

函数预处理用途证据
atStringHash(str, init=0)大小写不敏感(转小写)、\ → /、若以 " 开头则到下一个 " 为止资产名、模型名、字典键、atHashString、脚本 GET_HASH_KEY 风格的哈希src/dev_ng/rage/base/src/string/stringhash.h:14-34、src/dev_ng/rage/base/src/string/stringhash.cpp:79-101、src/dev_ng/rage/base/src/string/stringhash.cpp:163-173
atPartialStringHash + atFinalizeHash同上,但不做最终雪崩增量拼接哈希(atMultiStringHash 即用它串联多段)src/dev_ng/rage/base/src/string/stringhash.h:43-64、src/dev_ng/rage/base/src/string/stringhash.cpp:136-159
atLiteralStringHash区分大小写、不处理引号与斜杠parser 的结构/成员名哈希、PSO 类型名src/dev_ng/rage/base/src/string/stringhash.h:88-97、src/dev_ng/rage/base/src/string/stringhash.cpp:220-236
atDataHash / atPartialDataHash任意字节二进制数据src/dev_ng/rage/base/src/string/stringhash.h:99-125
atDataHash64Google CityHash6464 位数据哈希src/dev_ng/rage/base/src/string/stringhash.h:127-132、string/city.h
ATSTRINGHASH("name", 0x…)断言构建中运行时校验预计算常量是否等于 atStringHash("name"),否则直接是常量代码中硬编码哈希的惯用写法src/dev_ng/rage/base/src/string/stringhash.h:134-142
atHash_const_char旧 PJW/ELF 风格哈希,注释要求永不修改(结果被存进中间文件)atMap<const char*> 的默认哈希src/dev_ng/rage/base/src/atl/map.cpp:64-70、src/dev_ng/rage/base/src/atl/map.h:63-68

离线工具中有同算法的 Python 实现(atLiteralStringHash、atStringHash = 小写 + \→/ 后再算字面哈希),parCodeGen 用它预计算 NameHash src/dev_ng/rage/base/tools/cli/parCodeGen/atHash.py:1-23。

4.2 atHashString 家族与命名空间#

哈希字符串类只存一个 u32 m_hash;字符串(若保留)存放在按命名空间划分的全局表中:

命名空间哈希函数字符串表所在堆 / 预分配typedef
HSNS_ATHASHSTRINGatStringHash调试堆,预设最大槽数 ATL_MAP_MAX_SIZEatNonFinalHashString;非 Final 中 atHashString = 它
HSNS_ATFINALHASHSTRINGatStringHash游戏堆atFinalHashString(Final 中也保留字符串)
HSNS_ATLITERALHASHSTRINGatLiteralStringHash游戏堆atLiteralHashString / atLiteralHashValue
HSNS_DIAGSTRING带盐的字面哈希调试堆atDiagHashString
HSNS_STATNAMESTRINGatStringHash调试堆atStatNameString(多人统计名)

证据:命名空间枚举 src/dev_ng/rage/base/src/atl/hashstring.h:44-57;初始化参数 src/dev_ng/rage/base/src/atl/hashstring.cpp:315-333;typedef src/dev_ng/rage/base/src/atl/hashstring.h:362-389。

要点:

  • 构建差异:atHashString 在 !__FINAL 下是带字符串的 atNonFinalHashString,在 Final 中退化为只有哈希的 atHashValue;atHashWithStringDev(仅 __DEV 保留)、atHashWithStringBank(仅 __BANK 保留)、atHashWithStringNotFinal 同理 src/dev_ng/rage/base/src/atl/hashstring.h:362-380。这正是 CHealthConfigInfo::GetName() 只在非 Final 可用的原因(见 parser-and-metadata.md 示例)。
  • atNamespacedHashString 从字符串构造时同时计算哈希并 AddString 注册;atNamespacedHashValue 只算哈希不注册;二者间转换需显式(防止误把“值”当“串”) src/dev_ng/rage/base/src/atl/hashstring.h:118-203。
  • AddString 在命名空间临界区内查表;同哈希不同串视为碰撞并断言——但源码保留了若干“GTA V 数据特有、无法通过改数据解决”的已知碰撞白名单;-breakonname 可在注册某名字时断点 src/dev_ng/rage/base/src/atl/hashstring.cpp:88-121、src/dev_ng/rage/base/src/atl/hashstring.cpp:16。
  • 静态初始化顺序:hashstring.cpp 使用 #pragma init_seg(lib) / init_priority(101/102) 并提供 atHashStringNamespaceSupport::EarlyInit,供可能更早静态构造哈希串的翻译单元使用 src/dev_ng/rage/base/src/atl/hashstring.cpp:20-51、src/dev_ng/rage/base/src/atl/hashstring.h:76-82。
  • 调试输出惯用 HASHFMT/HASHOUT(x) 打印“名字 (0x哈希)” src/dev_ng/rage/base/src/atl/hashstring.h:18-19。

命名约定小结:资产/实体/对象名用大小写不敏感的 atStringHash(atHashString/atFinalHashString/pgDictionary 键);反射与 PSO 内部标识用区分大小写的 atLiteralStringHash(atLiteralHashString);代码中的硬编码常量用 ATSTRINGHASH("x", 0x…) 包装以便断言构建校验。

4.3 其它字符串工具#

string/string.h 提供 safecpy/safecat/formatf/vformatf(带数组长度推导的模板版本)、ConstString(共享常量串,ConstStringDuplicate/ConstStringFree 不可与 StringFree 混用) src/dev_ng/rage/base/src/string/string.h:153、src/dev_ng/rage/base/src/string/string.h:256-386、src/dev_ng/rage/base/src/string/string.h:465-570。 atStringHeap 是基于句柄、可整理碎片的字符串堆(最大 512 KB、8192 句柄、≤240 字节分档空闲表、支持 Touch/GarbageCollect) src/dev_ng/rage/base/src/string/stringheap.h:15-37。另有 atStringBuilder、unicode.h(UTF-8/UTF-16 转换)、stringutil.h。


5. atl 容器#

5.1 数组族#

类型布局与语义证据
atArray<T, Align=0, Counter=u16>T* m_Elements; Counter m_Count, m_Capacity;(64 位下补 4 字节)。默认计数器 u16 → 容量上限 65535;元素按 max(alignof(T), _Align, ATL_ARRAY_MIN_ALIGN=16) 对齐分配src/dev_ng/rage/base/src/atl/array.h:114-120、src/dev_ng/rage/base/src/atl/array.h:156-200、src/dev_ng/rage/base/src/atl/array.h:667-675
增长策略Grow(allocStep=16) / PushAndGrow 按固定步长线性扩容并逐元素拷贝(不是几何增长);Append 超容量 TrapGE;Reserve 只能在容量为 0 时调用;ResizeGrow 可超出容量src/dev_ng/rage/base/src/atl/array.h:329-399、src/dev_ng/rage/base/src/atl/array.h:493-494
资源构造atArray(datResource&) 只修复元素指针;atArray(rsc, true) 还对每个元素调用 Place;(rsc, true, flag2) 用于嵌套数组src/dev_ng/rage/base/src/atl/array.h:262-283
查找/排序Find/ReverseFind(线性)、BinarySearch(要求已排序)、QSortsrc/dev_ng/rage/base/src/atl/array.h:522-575
atFixedArray<T, N>内联存储 + 计数src/dev_ng/rage/base/src/atl/array.h:858-880
atRangeArray<T, N>定长 C 数组 + 越界检查,无计数src/dev_ng/rage/base/src/atl/array.h:1233-1234
atUserArray、atMultiRangeArray、atMultiArray2d/3d、atSpanArray、atVector、atFixedVector外部存储数组、多维数组、STL 风格向量src/dev_ng/rage/base/src/atl/array.h:807-1576、src/dev_ng/rage/base/src/atl/vector.h:48-788

5.2 映射族#

类型实现证据
atMap<K, D, Hash, Equals, Memory>链式哈希表:Entry** m_Hash、u16 m_Slots/m_Used;槽数取自素数表 atHashNextSize(11, 29, 59 … 65167, 65521);条目数达到槽数时(仅当 m_AllowReCompute)重哈希到下一素数;默认构造不分配,首次插入 Create(10) → 11 槽且允许重哈希;const char* 键默认用 atHash_const_charsrc/dev_ng/rage/base/src/atl/map.h:249-265、src/dev_ng/rage/base/src/atl/map.h:360-410、src/dev_ng/rage/base/src/atl/map.h:620-637、src/dev_ng/rage/base/src/atl/map.h:694-701、src/dev_ng/rage/base/src/atl/map.cpp:36-60
atMapEntry 资源构造可选择只修复 next,或同时放置键/值src/dev_ng/rage/base/src/atl/map.h:130-152
atBinaryMap<T, Key>有序 atArray<DataPair>;Insert 后必须 FinishInsertion() 排序,SafeGet 用 std::lower_bound(O(log N)),未排序时断言src/dev_ng/rage/base/src/atl/binmap.h:16-29、src/dev_ng/rage/base/src/atl/binmap.h:430-448、src/dev_ng/rage/base/src/atl/binmap.h:600-608
atHashedMap / atStringMap<T>在 atBinaryMap 上把字符串键先哈希(atStringMap 用 atStringHash),不存原串src/dev_ng/rage/base/src/atl/binmap.h:618-657、src/dev_ng/rage/base/src/atl/binmap.h:768-789
inmap / inlist侵入式红黑树映射 / 链表(节点嵌在对象内,如 bkWidget::m_RemoteToLocalNode)src/dev_ng/rage/base/src/atl/inmap.h:61-370、src/dev_ng/rage/base/src/atl/inlist.h:168-209

5.3 池、链表与其它#

类型说明证据
atPoolBase / atPool<T>固定大小元素池,空闲链表把“下一个空闲”指针写在空闲元素首部;满时(断言构建)Quitf("atPool is full ...");可选 spillover 池;PoolTracker 用于调试统计src/dev_ng/rage/base/src/atl/pool.h:100-150、src/dev_ng/rage/base/src/atl/pool.cpp:195-206、src/dev_ng/rage/base/src/atl/pool.cpp:320-363
atStaticPool<T, N>编译期容量的静态池(sysIpc 的信号量/互斥量池即用它)src/dev_ng/rage/base/src/atl/staticpool.h:36
atPagedPool、atDynaPool、atFreeList分页池、带统计的动态池、空闲表src/dev_ng/rage/base/src/atl/pagedpool.h:44、src/dev_ng/rage/base/src/atl/dynapool.h:74-114、src/dev_ng/rage/base/src/atl/freelist.h:15-111
atString / atWideString / atFixedString堆字符串(u16 长度与容量)、宽字符串、定长字符串src/dev_ng/rage/base/src/atl/string.h:22-27、src/dev_ng/rage/base/src/atl/string.h:644-645
atBitSet / atFixedBitSet<N>位集src/dev_ng/rage/base/src/atl/bitset.h:30-509
atQueue、atSlidingArray、atBinHeap、atFibHeap队列与堆src/dev_ng/rage/base/src/atl/queue.h:23-532、src/dev_ng/rage/base/src/atl/binheap.h:47、src/dev_ng/rage/base/src/atl/fibheap.h:57
atDList/atSList节点式双/单向链表src/dev_ng/rage/base/src/atl/dlist.h:39-175、src/dev_ng/rage/base/src/atl/slist.h:26-382
atDelegate/atDelegator/atClosure、Functor0..N委托与函数对象(bkManager::Invoke、RFS 连接回调等使用)src/dev_ng/rage/base/src/atl/delegate.h:224-226、src/dev_ng/rage/base/src/atl/functor.h:86-245
atPtr、atOwnedPtr、atReferenceCounter智能指针与引用计数src/dev_ng/rage/base/src/atl/ptr.h:177、src/dev_ng/rage/base/src/atl/ownedptr.h:34、src/dev_ng/rage/base/src/atl/referencecounter.h:46
atSingleton<T>Instantiate/InstancePtr/InstanceRef/Destroy 的单例包装src/dev_ng/rage/base/src/atl/singleton.h:22-75
其它atAny、atCache、atBucket、atInBinTree、atInUnionFind、Uuid/guidsrc/dev_ng/rage/base/src/atl/any.h:47、src/dev_ng/rage/base/src/atl/cache.h:94、src/dev_ng/rage/base/src/atl/bucket.h:38、src/dev_ng/rage/base/src/atl/atinbintree.h:115、src/dev_ng/rage/base/src/atl/inunionfind.h:143

6. curve、spatialdata、xmldata、init、deprecated#

模块内容证据
curve模板曲线基类 cvCurve<Vector> 与管理器 cvCurveMgr;NURBS(cvCurveNurbs)、Catmull-Rom(cvCurveCatRom)、Maya 曲线导入(mayaCurve)src/dev_ng/rage/base/src/curve/curve.h:44-137、src/dev_ng/rage/base/src/curve/curvemgr.h:24、src/dev_ng/rage/base/src/curve/curvenurbs.h:78、src/dev_ng/rage/base/src/curve/curvecatrom.h:27、src/dev_ng/rage/base/src/curve/mayacurve.h:69
spatialdataspdAABB(两个 Vec4V,w 分量可存用户数据,可被 parser 反射)、spdRect、spdOrientedBB、spdSphere、spdPlane、spdTransposedPlaneSet4/8(SIMD 视锥平面)、2D kDOP、spdGrid2D、spdQuadtree、spdConvexHull2D、kD 树 bkdtree、多叉 BVH spdMNBVH(节点 128 字节对齐、每节点 16 项)src/dev_ng/rage/base/src/spatialdata/aabb.h:31-148、src/dev_ng/rage/base/src/spatialdata/sphere.h:21、src/dev_ng/rage/base/src/spatialdata/transposedplaneset.h:19-76、src/dev_ng/rage/base/src/spatialdata/kdop2d.h:66-322、src/dev_ng/rage/base/src/spatialdata/grid2d.h:32、src/dev_ng/rage/base/src/spatialdata/quadtree.h:92、src/dev_ng/rage/base/src/spatialdata/mnbvh.h:76、src/dev_ng/rage/base/src/spatialdata/metadata.psc:4-13
xmldata旧式 XML 数据模型(aAttributes、aDataType 派生的 aInt/aString…)与 xmlAsciiTokenizerXmlsrc/dev_ng/rage/base/src/xmldata/data.h:35-216、src/dev_ng/rage/base/src/xmldata/datatypes.h:33-218、src/dev_ng/rage/base/src/xmldata/xmltoken.h:24
initINI 文件解析器 initIni(节/键大小写不敏感、按需类型化取值 string/bool/int/float/Vector3/Vector4/Color32、; 注释、转义序列)。注意:它不是“模块初始化”框架;仓库中检索到的使用者主要是工具(DCC/CLI)src/dev_ng/rage/base/src/init/ini.h:27-91
deprecated旧的空间结构:BSP(spdBspTree)、视锥/“shaft”(spdShaft)、BDAM 地形树、多边形、轴对齐无限圆柱、世界调试绘制src/dev_ng/rage/base/src/deprecated/bsp.h:221、src/dev_ng/rage/base/src/deprecated/shaft.h:233、src/dev_ng/rage/base/src/deprecated/bdamtree.h:34、src/dev_ng/rage/base/src/deprecated/polygon.h:58;在 game/ 与 rage/framework/src 中未检索到对 deprecated/ 头文件的包含

约束与边界行为#

  • atArray 默认 u16 计数:超过 65535 个元素需显式使用 u32 计数器模板参数;Grow 线性增长,大数组反复 PushAndGrow 是 O(n²) 拷贝。
  • atMap 槽数/条目数均为 u16,最大 65521 槽;SetAllowRecompute(false)(例如资源化或预分配的表)时不会扩容,链会无限变长。
  • atBinaryMap 在 FinishInsertion() 前查找会断言;atStringMap 不保存原字符串,无法反查名字。
  • atStringHash 大小写不敏感且把 \ 当 /,atLiteralStringHash 区分大小写——两者对同一字符串产生不同值,混用会导致查找失败。
  • Final 构建中 atHashString 没有字符串:任何依赖 GetCStr() 的逻辑都必须用 atFinalHashString 或 #if !__FINAL 保护。
  • ScalarV 必须保持 splat;Vec3V 的 w 分量不可依赖(spdAABB 等明确把 w 用作用户数据)。
  • Win32 PC 上 Vec3V_In 是引用,其他平台是值,跨平台代码不应依赖参数别名语义。

未决问题 / 证据不足#

  • vectormath 平台核心 .inl(尤其 win32pc 版本中 SSE4.1 指令的具体使用)与 SoA 类型的完整 API 未逐一核对。
  • mathext/lcp.h 与物理求解器的具体调用关系留给 09-physics/rage-physics-engine.md。
  • atPagedPool、atDynaPool、inmap 的实现细节只做了类型存在确认。