Ctrl + [, S
Monday, August 28, 2023
Thursday, August 24, 2023
Collision detection : Circle vs Rectangle
detection only
int CheckHit( F_RECT *prcRect1, F_CIRCLE *pcrCircle2 )
{
int nResult = false;
float ar;
if ( ( pcrCircle2->x > prcRect1->fLeft - pcrCircle2->r ) &&
( pcrCircle2->x < prcRect1->fRight + pcrCircle2->r ) &&
( pcrCircle2->y > prcRect1->fTop - pcrCircle2->r ) &&
( pcrCircle2->y < prcRect1->fBottom + pcrCircle2->r ) )
{
nResult = true;
ar = pcrCircle2->r;
if ( pcrCircle2->x < prcRect1->fLeft ) {
if ( ( pcrCircle2->y < prcRect1->fTop ) )
{
if ( ( DistanceSqr( prcRect1->fLeft, prcRect1->fTop,
pcrCircle2->x, pcrCircle2->y ) >= ar * ar ) ) {
nResult = false;
}
}
else {
if ( ( pcrCircle2->y > prcRect1->fBottom ) )
{
if ( ( DistanceSqr( prcRect1->fLeft, prcRect1->fBottom,
pcrCircle2->x, pcrCircle2->y ) >= ar * ar ) ) {
nResult = false;
}
}
}
}
else {
if ( pcrCircle2->x > prcRect1->fRight ) {
if ( ( pcrCircle2->y < prcRect1->fTop ) )
{
if ( ( DistanceSqr( prcRect1->fRight, prcRect1->fTop,
pcrCircle2->x, pcrCircle2->y ) >= ar * ar ) ) {
nResult = false;
}
}
else {
if ( ( pcrCircle2->y > prcRect1->fBottom ) )
{
if ( ( DistanceSqr( prcRect1->fRight, prcRect1->fBottom,
pcrCircle2->x, pcrCircle2->y ) >= ar * ar ) ) {
nResult = false;
}
}
}
}
}
}
return nResult;
}
Wednesday, August 9, 2023
대화의 격률
https://ko.wikipedia.org/wiki/%EA%B7%B8%EB%9D%BC%EC%9D%B4%EC%8A%A4%EC%9D%98_%EB%8C%80%ED%99%94%EA%B2%A9%EB%A5%A0
Monday, July 31, 2023
Unreal Engine's DrawDebugCone
There are two versions of implementation of DrawDebugCone.
One it takes two angles in radians and other one takes degrees. OTL
Tuesday, July 11, 2023
Order of mov (assembler)
mov ax, 3
which mean move a number 3 into ax register. This is an intel assembler order.
Other assembler use opposite order for instance
mov 3, ax
which is exactly same meanning like shown above.
Monday, July 10, 2023
three types of locks
1. Try lock
try it only once
2. Spin lock
try forever until it acquires the lock
3. Timeout lock
try it for up to some period of time
Sunday, July 9, 2023
UGameplayStatics, Static class with useful gameplay utility functions
UGameplayStatics, Static class with useful gameplay utility functions
Task in UnrealEngine
https://www.youtube.com/watch?v=1lBadANnJaw
-
Unity released very good FPS example for people and I decided to analysis how they make this. Personally I wanted to show you how I analys...
-
Because nature of rotation angle, when we interpolate angles we could have some problems. For instance we have angle A0 and A1. A0 is -...
-
For instance I have 45 degree rotation quaternion p. and if I take p ^ (1/3) then I'll get 15 degree rotation quaternion. This is geomet...