public Vector2 GetForce(VerletPoint point) {
Vector2 toMe = point.Position - otherVerlet.Position;
00000000 push ebp
00000001 mov ebp,esp
00000003 push edi
00000004 push esi
00000005 push ebx
00000006 sub esp,78h
00000009 mov esi,ecx
0000000b lea edi,[ebp-24h]
0000000e mov ecx,6
00000013 xor eax,eax
00000015 rep stos dword ptr es:[edi]
00000017 mov ecx,esi
00000019 mov dword ptr [ebp+FFFFFF7Ch],edx
0000001f mov ebx,ecx
00000021 cmp dword ptr ds:[01C68888h],0
00000028 je 0000002F
0000002a call 78080DEE
0000002f lea edx,[ebp-2Ch]
00000032 mov ecx,dword ptr [ebp+8]
00000035 cmp dword ptr [ecx],ecx
00000037 call dword ptr ds:[01C698A0h]
0000003d mov ecx,dword ptr [ebx+4]
00000040 lea edx,[ebp-34h]
00000043 cmp dword ptr [ecx],ecx
00000045 call dword ptr ds:[01C698A0h]
0000004b lea eax,[ebp-2Ch]
0000004e sub esp,8
00000051 movq xmm0,mmword ptr [eax]
00000055 movq mmword ptr [esp],xmm0
0000005a lea eax,[ebp-34h]
0000005d sub esp,8
00000060 movq xmm0,mmword ptr [eax]
00000064 movq mmword ptr [esp],xmm0
00000069 lea ecx,[ebp-3Ch]
0000006c call dword ptr ds:[01C69700h]
00000072 lea edi,[ebp-14h]
00000075 lea esi,[ebp-3Ch]
00000078 movq xmm0,mmword ptr [esi]
0000007c movq mmword ptr [edi],xmm0
if (toMe.Magnitude() < 0.000001f)
00000080 lea ecx,[ebp-14h]
00000083 call dword ptr ds:[01C696F8h]
00000089 fstp dword ptr [ebp-40h]
0000008c fld dword ptr [ebp-40h]
0000008f fld dword ptr ds:[020116A8h]
00000095 fcomip st,st(1)
00000097 fstp st(0)
00000099 jp 000000BA
0000009b jbe 000000BA
toMe = new Vector2(1, 0);
0000009d push 3F800000h
000000a2 push 0
000000a4 lea ecx,[ebp-80h]
000000a7 call FFFFFF88
000000ac lea edi,[ebp-14h]
000000af lea esi,[ebp-80h]
000000b2 movq xmm0,mmword ptr [esi]
000000b6 movq mmword ptr [edi],xmm0
Vector2 mid = otherVerlet.Position - Vector2.Normalize(ref toMe);
000000ba mov ecx,dword ptr [ebx+4]
000000bd lea edx,[ebp-48h]
000000c0 cmp dword ptr [ecx],ecx
000000c2 call dword ptr ds:[01C698A0h]
000000c8 lea ecx,[ebp-50h]
000000cb lea edx,[ebp-14h]
000000ce call dword ptr ds:[01C696FCh]
000000d4 lea eax,[ebp-48h]
000000d7 sub esp,8
000000da movq xmm0,mmword ptr [eax]
000000de movq mmword ptr [esp],xmm0
000000e3 lea eax,[ebp-50h]
000000e6 sub esp,8
000000e9 movq xmm0,mmword ptr [eax]
000000ed movq mmword ptr [esp],xmm0
000000f2 lea ecx,[ebp-58h]
000000f5 call dword ptr ds:[01C69700h]
000000fb lea edi,[ebp-1Ch]
000000fe lea esi,[ebp-58h]
00000101 movq xmm0,mmword ptr [esi]
00000105 movq mmword ptr [edi],xmm0
Vector2 toMid = mid - point.Position;
00000109 lea edi,[ebp-60h]
0000010c lea esi,[ebp-1Ch]
0000010f movq xmm0,mmword ptr [esi]
00000113 movq mmword ptr [edi],xmm0
00000117 lea edx,[ebp-68h]
0000011a mov ecx,dword ptr [ebp+8]
0000011d cmp dword ptr [ecx],ecx
0000011f call dword ptr ds:[01C698A0h]
00000125 lea eax,[ebp-60h]
00000128 sub esp,8
0000012b movq xmm0,mmword ptr [eax]
0000012f movq mmword ptr [esp],xmm0
00000134 lea eax,[ebp-68h]
00000137 sub esp,8
0000013a movq xmm0,mmword ptr [eax]
0000013e movq mmword ptr [esp],xmm0
00000143 lea ecx,[ebp-70h]
00000146 call dword ptr ds:[01C69700h]
0000014c lea edi,[ebp-24h]
0000014f lea esi,[ebp-70h]
00000152 movq xmm0,mmword ptr [esi]
00000156 movq mmword ptr [edi],xmm0
return toMid * force;
0000015a lea eax,[ebp-24h]
0000015d sub esp,8
00000160 movq xmm0,mmword ptr [eax]
00000164 movq mmword ptr [esp],xmm0
00000169 push dword ptr [ebx+8]
0000016c lea ecx,[ebp-78h]
0000016f call dword ptr ds:[01C69704h]
00000175 mov edi,dword ptr [ebp+FFFFFF7Ch]
0000017b lea esi,[ebp-78h]
0000017e movq xmm0,mmword ptr [esi]
00000182 movq mmword ptr [edi],xmm0
00000186 lea esp,[ebp-0Ch]
00000189 pop ebx
0000018a pop esi
0000018b pop edi
0000018c pop ebp
0000018d ret 4 |
public Vector2 GetForce(VerletPoint point) {
Vector2 toMe = Vector2.Subtract(ref point.Position, ref otherVerlet.Position);
00000000 push ebp
00000001 mov ebp,esp
00000003 push edi
00000004 push esi
00000005 push ebx
00000006 sub esp,50h
00000009 mov esi,ecx
0000000b lea edi,[ebp-2Ch]
0000000e mov ecx,8
00000013 xor eax,eax
00000015 rep stos dword ptr es:[edi]
00000017 mov ecx,esi
00000019 mov dword ptr [ebp-5Ch],edx
0000001c mov ebx,ecx
0000001e cmp dword ptr ds:[01C68888h],0
00000025 je 0000002C
00000027 call 78080E3E
0000002c mov eax,dword ptr [ebp+8]
0000002f cmp al,byte ptr [eax+4]
00000032 lea esi,[eax+4]
00000035 mov eax,dword ptr [ebx+4]
00000038 cmp al,byte ptr [eax+4]
0000003b lea eax,[eax+4]
0000003e push eax
0000003f mov edx,esi
00000041 lea ecx,[ebp-34h]
00000044 call dword ptr ds:[01C69710h]
0000004a lea edi,[ebp-14h]
0000004d lea esi,[ebp-34h]
00000050 movq xmm0,mmword ptr [esi]
00000054 movq mmword ptr [edi],xmm0
if (toMe.Magnitude() < 0.000001f)
00000058 lea ecx,[ebp-14h]
0000005b call dword ptr ds:[01C69700h]
00000061 fstp dword ptr [ebp-38h]
00000064 fld dword ptr [ebp-38h]
00000067 fld dword ptr ds:[020115DCh]
0000006d fcomip st,st(1)
0000006f fstp st(0)
00000071 jp 00000092
00000073 jbe 00000092
toMe = new Vector2(1, 0);
00000075 push 3F800000h
0000007a push 0
0000007c lea ecx,[ebp-58h]
0000007f call FFFFFFC8
00000084 lea edi,[ebp-14h]
00000087 lea esi,[ebp-58h]
0000008a movq xmm0,mmword ptr [esi]
0000008e movq mmword ptr [edi],xmm0
Vector2 normal = Vector2.Normalize(ref toMe);
00000092 lea ecx,[ebp-40h]
00000095 lea edx,[ebp-14h]
00000098 call dword ptr ds:[01C69704h]
0000009e lea edi,[ebp-1Ch]
000000a1 lea esi,[ebp-40h]
000000a4 movq xmm0,mmword ptr [esi]
000000a8 movq mmword ptr [edi],xmm0
Vector2 mid = Vector2.Subtract(ref otherVerlet.Position, ref normal);
000000ac mov eax,dword ptr [ebx+4]
000000af cmp al,byte ptr [eax+4]
000000b2 lea esi,[eax+4]
000000b5 lea eax,[ebp-1Ch]
000000b8 push eax
000000b9 mov edx,esi
000000bb lea ecx,[ebp-48h]
000000be call dword ptr ds:[01C69710h]
000000c4 lea edi,[ebp-24h]
000000c7 lea esi,[ebp-48h]
000000ca movq xmm0,mmword ptr [esi]
000000ce movq mmword ptr [edi],xmm0
Vector2 toMid = Vector2.Subtract(ref mid, ref point.Position);
000000d2 mov eax,dword ptr [ebp+8]
000000d5 cmp al,byte ptr [eax+4]
000000d8 lea eax,[eax+4]
000000db push eax
000000dc lea ecx,[ebp-50h]
000000df lea edx,[ebp-24h]
000000e2 call dword ptr ds:[01C69710h]
000000e8 lea edi,[ebp-2Ch]
000000eb lea esi,[ebp-50h]
000000ee movq xmm0,mmword ptr [esi]
000000f2 movq mmword ptr [edi],xmm0
toMid.Scale(force);
000000f6 push dword ptr [ebx+8]
000000f9 lea ecx,[ebp-2Ch]
000000fc call dword ptr ds:[01C69714h]
return toMid;
00000102 mov edi,dword ptr [ebp-5Ch]
00000105 lea esi,[ebp-2Ch]
00000108 movq xmm0,mmword ptr [esi]
0000010c movq mmword ptr [edi],xmm0
00000110 lea esp,[ebp-0Ch]
00000113 pop ebx
00000114 pop esi
00000115 pop edi
00000116 pop ebp
00000117 ret 4 |
Vector2 CSemiRigidConstraint::GetForce(CVerletPoint* p_verlet)
{
Vector2 to_me = p_verlet->GetPos() - mp_other_verlet->GetPos();
00405860 mov edx,dword ptr [ecx+4]
00405863 fld dword ptr [edx]
00405865 sub esp,8
00405868 fld dword ptr [edx+4]
0040586B push esi
0040586C mov esi,dword ptr [esp+14h]
00405870 fld dword ptr [esi]
00405872 fsubrp st(2),st
00405874 fsubr dword ptr [esi+4]
if (to_me.Length() < 0.000001)
00405877 fld st(0)
00405879 fmul st,st(1)
0040587B fld st(2)
0040587D fmul st,st(3)
0040587F faddp st(1),st
00405881 fsqrt
00405883 fcomp qword ptr [__real@3eb0c6f7a0b5ed8d (414508h)]
00405889 fnstsw ax
0040588B fld1
0040588D test ah,5
00405890 fldz
00405892 jp CSemiRigidConstraint::GetForce+46h (4058A6h)
{
to_me = Vector2(1.0f,0.0f);
00405894 fstp st(3)
00405896 fstp st(1)
00405898 fld st(0)
0040589A fld st(2)
0040589C fxch st(1)
0040589E fxch st(3)
004058A0 fxch st(1)
004058A2 fxch st(2)
004058A4 fxch st(1)
}
Vector2 mid = mp_other_verlet->GetPos() + to_me.Normal()*m_mid;
004058A6 fld st(2)
004058A8 fmul st,st(3)
004058AA fld st(4)
004058AC fmul st,st(5)
004058AE faddp st(1),st
004058B0 fsqrt
004058B2 fcom st(1)
004058B4 fnstsw ax
004058B6 fstp st(1)
004058B8 test ah,41h
004058BB jne CSemiRigidConstraint::GetForce+67h (4058C7h)
004058BD fdivp st(1),st
004058BF fld st(0)
004058C1 fmulp st(3),st
004058C3 fmulp st(1),st
004058C5 jmp CSemiRigidConstraint::GetForce+77h (4058D7h)
004058C7 fstp st(0)
004058C9 fstp st(2)
004058CB fstp st(0)
004058CD fstp st(0)
004058CF fld dword ptr [esp+4]
004058D3 fld dword ptr [esp+8]
004058D7 fld dword ptr [ecx+0Ch]
Vector2 to_mid = mid-p_verlet->GetPos() ;
return to_mid*m_force;
004058DA mov eax,dword ptr [esp+10h]
004058DE fmul st(2),st
004058E0 fmulp st(1),st
004058E2 fld dword ptr [edx]
004058E4 faddp st(2),st
004058E6 fadd dword ptr [edx+4]
004058E9 fld dword ptr [esi]
004058EB fld dword ptr [esi+4]
004058EE pop esi
004058EF fxch st(3)
004058F1 fsubrp st(1),st
004058F3 fxch st(1)
004058F5 fsubrp st(2),st
004058F7 fld dword ptr [ecx+14h]
004058FA fmul st(1),st
004058FC fxch st(1)
004058FE fstp dword ptr [eax]
00405900 fmulp st(1),st
00405902 fstp dword ptr [eax+4]
}
00405905 add esp,8
00405908 ret 8
|
float v_x = p_verlet->GetPos().x;
004062F9 mov eax,dword ptr [p_verlet]
004062FC movss xmm5,dword ptr [eax]
float v_y = p_verlet->GetPos().y;
00406300 movss xmm6,dword ptr [eax+4]
float o_x = mp_other_verlet->GetPos().x;
00406305 mov eax,dword ptr [ecx+4]
float o_y = mp_other_verlet->GetPos().y;
00406308 movss xmm0,dword ptr [eax+4]
0040630D movss xmm7,dword ptr [eax]
00406311 movss dword ptr [esp+4],xmm0
float t_x = (v_x - o_x);
00406317 movaps xmm1,xmm5
0040631A subss xmm1,xmm7
float t_y = (v_y - o_y);
0040631E movaps xmm2,xmm6
00406321 subss xmm2,xmm0
float t_len = sqrtf(t_x*t_x + t_y*t_y);
00406325 movaps xmm0,xmm2
00406328 movaps xmm3,xmm1
0040632B mulss xmm0,xmm2
0040632F mulss xmm3,xmm1
00406333 addss xmm0,xmm3
if (t_len <0.000001) // should be f, but leave it for comparison
00406337 movsd xmm3,mmword ptr [__real@3eb0c6f7a0b5ed8d (418048h)]
0040633F sqrtss xmm4,xmm0
00406343 cvtss2sd xmm0,xmm4
00406347 comisd xmm3,xmm0
0040634B jbe CSemiRigidConstraint::GetForce+6Bh (40635Bh)
{
t_x = 1.0f;
0040634D movss xmm1,dword ptr [__real@3f800000 (41803Ch)]
t_y = 0.0f;
00406355 xorps xmm2,xmm2
t_len = 1.0f;
00406358 movaps xmm4,xmm1
}
float mid = m_mid;
0040635B movss xmm0,dword ptr [ecx+0Ch]
float m_x = o_x + t_x/t_len*mid;
float m_y = o_y + t_y/t_len*mid;
float tm_x = m_x - v_x;
float tm_y = m_y - v_y;
float force = m_force;
00406360 movss xmm3,dword ptr [ecx+14h]
return Vector2(tm_x*force,tm_y*force);
00406365 mov eax,dword ptr [ebp+8]
00406368 divss xmm0,xmm4
0040636C movaps xmm4,xmm0
0040636F mulss xmm4,xmm1
00406373 mulss xmm0,xmm2
00406377 addss xmm0,dword ptr [esp+4]
0040637D addss xmm4,xmm7
00406381 subss xmm4,xmm5
00406385 subss xmm0,xmm6
00406389 mulss xmm4,xmm3
0040638D mulss xmm0,xmm3
00406391 movss dword ptr [eax],xmm4
00406395 movss dword ptr [eax+4],xmm0
#endif
}
0040639A mov esp,ebp
0040639C pop ebp
0040639D ret 8
|
float v_x = p_verlet->GetPos().x;
00405860 mov eax,dword ptr [esp+8]
00405864 fld dword ptr [eax]
float v_y = p_verlet->GetPos().y;
00405866 fld dword ptr [eax+4]
float o_x = mp_other_verlet->GetPos().x;
00405869 mov eax,dword ptr [ecx+4]
0040586C fld dword ptr [eax]
float o_y = mp_other_verlet->GetPos().y;
0040586E fld dword ptr [eax+4]
00405871 fst dword ptr [esp+8]
float t_x = (v_x - o_x);
00405875 fld st(3)
00405877 fsub st,st(2)
float t_y = (v_y - o_y);
00405879 fld st(3)
0040587B fsubrp st(2),st
float t_len = sqrtf(t_x*t_x + t_y*t_y);
0040587D fld st(1)
0040587F fmul st,st(2)
00405881 fld st(1)
00405883 fmul st,st(2)
00405885 faddp st(1),st
00405887 fsqrt
if (t_len <0.000001) // should be f, but leave it for comparison
00405889 fcom qword ptr [__real@3eb0c6f7a0b5ed8d (414508h)]
0040588F fnstsw ax
00405891 test ah,5
00405894 jp CSemiRigidConstraint::GetForce+44h (4058A4h)
{
t_x = 1.0f;
t_y = 0.0f;
t_len = 1.0f;
00405896 fstp st(1)
00405898 fstp st(1)
0040589A fstp st(0)
0040589C fld1
0040589E fld st(0)
004058A0 fldz
004058A2 fxch st(2)
}
float mid = m_mid;
float m_x = o_x + t_x/t_len*mid;
float m_y = o_y + t_y/t_len*mid;
float tm_x = m_x - v_x;
float tm_y = m_y - v_y;
float force = m_force;
004058A4 fld dword ptr [ecx+14h]
return Vector2(tm_x*force,tm_y*force);
004058A7 mov eax,dword ptr [esp+4]
004058AB fld dword ptr [ecx+0Ch]
004058AE fdivrp st(2),st
004058B0 fld st(1)
004058B2 fmulp st(3),st
004058B4 fxch st(2)
004058B6 faddp st(4),st
004058B8 fxch st(3)
004058BA fsubrp st(5),st
004058BC fmul st(4),st
004058BE fxch st(4)
004058C0 fstp dword ptr [eax]
004058C2 fmulp st(1),st
004058C4 fadd dword ptr [esp+8]
004058C8 fsubrp st(1),st
004058CA fmulp st(1),st
004058CC fstp dword ptr [eax+4]
#endif
}
004058CF ret 8
|