数学与容器:vectormath / vector / math、atl 容器、字符串与哈希、curve、spatialdata
本页覆盖 RAGE 的“基础词汇”:两代向量数学库(SIMD 封装的 vectormath 与旧式 vector)、标量数学工具(math、mathext),atl 模板容器(数组、哈希表、二分映射、池、侵入式容器、智能指针)、字符串与哈希命名约定(atStringHash、atHashString 及其命名空间),以及 curve、spatialdata、xmldata、init(INI 解析)和 deprecated 目录。几乎所有其他页面中出现的 Vec3V、atArray、atHashString、spdAABB 都在这里定义。
背景与相关页面#
- 资源构造函数、
datResource修复与atArray的资源化见 paging-and-resources.md。 - parser 对这些类型的反射(
parMemberType中的TYPE_VEC3V、SUBTYPE_ATARRAY、SUBTYPE_ATBINARYMAP、SUBTYPE_ATNONFINALHASHSTRING等)见 parser-and-metadata.md。 - 游戏层的对象池
fwPool/CPools与本页的atPool不同,见 01-runtime/memory-and-pools.md 与 04-rage-framework/framework-systems.md。 - framework 数学扩展
fwmaths见 04-rage-framework/framework-systems.md。
相关源码文件#
| 区域 | 文件(相对 src/dev_ng/rage/base/src/) |
|---|---|
| vectormath | vectormath/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 / mathext | math/amath.h、random.h、float16.h、angmath.h、vecrand.h;mathext/lcp.h、linearalgebra.h、noise.h、subspaceid.h、hilbert.h |
| atl | atl/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 |
| string | string/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 AltiVecvector float、Intel__m128(Durango/Orbis 假定 SSE4.1,PC 假定 SSE2)、PSP2 NEONfloat32x4_tsrc/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 v | Vec3V 的 w 分量存在但语义未定义;ScalarV 要求四分量相同(splat),IsValid() 检查是否仍为 splat | src/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/Ref | Win32 PC 上 _In 为 const 引用,其余平台按值传寄存器(推断:与 MSVC 在 PC 上无法按值在寄存器中传递 __m128 有关,源码未注明原因);_Out 为 const 值以提醒不是按引用返回;注释建议性能敏感代码改用 Vec::V3Param128 | src/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/InvMagFast | src/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)保证仍含 wsrc/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.h | LCP 求解相关(atPriorityArray、phConstraintGraphEdge/Node),服务于物理约束 | src/dev_ng/rage/base/src/mathext/lcp.h:22-262 |
mathext/noise.h | PerlinNoise | src/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 |
atDataHash64 | Google CityHash64 | 64 位数据哈希 | 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_ATHASHSTRING | atStringHash | 调试堆,预设最大槽数 ATL_MAP_MAX_SIZE | atNonFinalHashString;非 Final 中 atHashString = 它 |
HSNS_ATFINALHASHSTRING | atStringHash | 游戏堆 | atFinalHashString(Final 中也保留字符串) |
HSNS_ATLITERALHASHSTRING | atLiteralStringHash | 游戏堆 | atLiteralHashString / atLiteralHashValue |
HSNS_DIAGSTRING | 带盐的字面哈希 | 调试堆 | atDiagHashString |
HSNS_STATNAMESTRING | atStringHash | 调试堆 | 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(要求已排序)、QSort | src/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_char | src/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/guid | src/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 |
spatialdata | spdAABB(两个 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…)与 xmlAsciiTokenizerXml | src/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 |
init | INI 文件解析器 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的实现细节只做了类型存在确认。