麦德三世 发表于 2012-9-24 23:33:33

随便记录一些关于物理体的东西

物理体可采用的五种形状:

Capsule 2
Mesh 5
Polytope 0,3,4
Sphere 1
Triangle


box 0
sphere 1
capsule 2
cylinder 3
convex hull 4
mesh(!!!) 5


定义形状的地方在phshData-element.unknown0中。


物理体可以绑定2个骨骼,一个头一个尾。骨骼的绑定位置在unknown0的末尾。


物理体所有可能的flag:

collidable
walkable
stackable
simulate on collision
ignore local bodies
always exists
do not simulate


所有的世界力场:

wind
explosion
energy
blood
magnetic
grass
brush
trees


这些flag都在unknown1里面。Priority和World force, Local Force也都在这里。



可见其中其实有不少未使用的flag。去除未使用的flag和没用位以后,最大的有效数值是:
<unknown1>0xBF000000FFFFFF00FFFFFFFF</unknown1>





前八位用于保存flag,后面有24位的无效值。其后是16位local force的flag和8位world force的flag。之后再是8位无效值。最后32位是Priority。

其中flag和world force顺序与上文列出的顺序相同。

麦德三世 发表于 2012-9-25 00:38:56

奇葩的物理体

oneonestar 发表于 2012-9-25 10:36:56

目前整理到的资料

<structure name="PHSH" version="1" size="132" >
    <description>Physics Shape</description>
    <field offset="0" name="unknown0" size="68" />
    <!-- Shape:
        0 - Box
        1 - Sphere
        2 - Capsule
        3 - Cylinder
        4 - Convex Hull
        5 - Mesh
        (0,3,4 - Polytope)
    -->
    <field offset="68" name="shape" size="1" />
    <field offset="69" name="somemoreunknown" size="3" />
    <field offset="72" name="unknown1" type="SmallReference" refTo="VEC3V0" />
    <field offset="80" name="unknown2" size="16" />
    <field offset="96" name="unknown4" type="SmallReference" refTo="U16_V0" />
    <field offset="104" name="unknown5" size="4" />
    <field offset="108" name="unknown6" type="SmallReference" refTo="VEC4V0" />
    <field offset="116" name="unknown7" size="16" />
</structure>
<structure name="PHRB" version="2" size="104" >
    <description>Physics Body</description>
    <field offset="0" name="unknown0" size="60" />
    <field offset="60" name="HeadBoneIndex" type="int16" />
    <field offset="62" name="TailBoneIndex" type="int16" />
    <field offset="64" name="somemoreunknown" size="16" />
    <field offset="80" name="phshData" type="Reference" refTo="PHSHV1" />
    <field offset="92" name="flags" type="uint32" />
    <field offset="96" name="localforce" type="uint16" />
    <field offset="98" name="worldforce" type="uint16" />
    <field offset="100" name="priority" size="4" />
</structure>

真难做 发表于 2015-1-14 09:59:46

页: [1]
查看完整版本: 随便记录一些关于物理体的东西