mirror of https://github.com/zeldaret/botw.git
ksys/phys: Match CapsuleBody::getVolume
This commit is contained in:
parent
eb16cbaf55
commit
64cc3c5856
|
@ -83577,7 +83577,7 @@ Address,Quality,Size,Name
|
||||||
0x0000007100fabb04,O,000072,_ZN4ksys4phys11CapsuleBodyD0Ev
|
0x0000007100fabb04,O,000072,_ZN4ksys4phys11CapsuleBodyD0Ev
|
||||||
0x0000007100fabb4c,m,000060,_ZN4ksys4phys11CapsuleBody9setRadiusEf
|
0x0000007100fabb4c,m,000060,_ZN4ksys4phys11CapsuleBody9setRadiusEf
|
||||||
0x0000007100fabb88,O,000192,_ZN4ksys4phys11CapsuleBody11setVerticesERKN4sead7Vector3IfEES6_
|
0x0000007100fabb88,O,000192,_ZN4ksys4phys11CapsuleBody11setVerticesERKN4sead7Vector3IfEES6_
|
||||||
0x0000007100fabc48,m,000140,_ZNK4ksys4phys11CapsuleBody9getVolumeEv
|
0x0000007100fabc48,O,000140,_ZNK4ksys4phys11CapsuleBody9getVolumeEv
|
||||||
0x0000007100fabcd4,O,000008,_ZN4ksys4phys11CapsuleBody8getShapeEv
|
0x0000007100fabcd4,O,000008,_ZN4ksys4phys11CapsuleBody8getShapeEv
|
||||||
0x0000007100fabcdc,O,000008,_ZNK4ksys4phys11CapsuleBody8getShapeEv
|
0x0000007100fabcdc,O,000008,_ZNK4ksys4phys11CapsuleBody8getShapeEv
|
||||||
0x0000007100fabce4,U,000252,
|
0x0000007100fabce4,U,000252,
|
||||||
|
|
Can't render this file because it is too large.
|
|
@ -74,13 +74,8 @@ bool CapsuleBody::setVertices(const sead::Vector3f& va, const sead::Vector3f& vb
|
||||||
}
|
}
|
||||||
|
|
||||||
f32 CapsuleBody::getVolume() const {
|
f32 CapsuleBody::getVolume() const {
|
||||||
f32 dy = vertex_a.y - vertex_b.y;
|
f32 dist = (vertex_a - vertex_b).length();
|
||||||
f32 dx = vertex_a.x - vertex_b.x;
|
return sead::Mathf::pi() * radius * radius * (dist + radius * 4.0f / 3.0f);
|
||||||
f32 dz = vertex_a.z - vertex_b.z;
|
|
||||||
f32 dist = sqrtf(dx * dx + dy * dy + dz * dz);
|
|
||||||
f32 pi_r_sq = radius * radius * sead::Mathf::pi();
|
|
||||||
f32 c = (radius * 4.0f) / 3.0f;
|
|
||||||
return pi_r_sq * (dist + c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hkpShape* CapsuleBody::getShape() {
|
hkpShape* CapsuleBody::getShape() {
|
||||||
|
|
Loading…
Reference in New Issue