Saturday, August 10, 2024

Monday, December 11, 2023

One Frame Animation

SkeletalMesh->PlayAnimation(MyAnim, false);
SkeletalMesh->bPauseAnims = true;
UAnimSingleNodeInstance* Inst = Cast<UAnimSingleNodeInstance>(AnimInstance);
if ( Inst )
{
    Inst->SetPosition(AnimTime);
}

Wednesday, November 22, 2023

Compile MD5 using openssl on linux

 cc digestMD5.c -o digestMd5 -L/usr/openssl/lib64 -lssl -lcrypto -ldl


I installed openssl into /usr/openssl


Or openssl is located in /opt/openssl

Wednesday, September 13, 2023

Baseball terms

심판 - Umpire


투수 - Pitcher


포수 - Catcher


타자 - Batter


지명타자 - Designated hitter


1루수 - First baseman


2루수 - Second baseman


3루수 - Third baseman


유격수 - Shortstop


좌익수 - Left fielder


중견수 - Center fielder


우익수 - Right fielder


중간계투/구원투수 - Bullpen pitcher


마무리투수 - Closer


주자 - Runner



눈치채셨겠지만


1루는 First base


2루는 Second base


3루는 Third base 입니다.




공을던지다 - Pitch the ball


공을 치다 - Hit the ball


파울 - foul ball


1루타 - single


2루타 - double


3루타 - triple


내야안타 - infield hit


홈런 - homerun


만루홈런 - grand slam


도루 - Stolen base


볼넷 - base on balls


삼진 - Strike out


직구 - Fast ball


변화구 - Breaking ball


내야 땅볼 - Ground out


직선타구 - Line drive


뜬공 - Fly ball


견제구 - Pick-off throw


땅볼 - Ground ball


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

Wednesday, July 5, 2023

Thursday, June 29, 2023

implement add with + operator with racket

 #lang racket


; implement add without + operator


(define add

  (λ (n m)

    (cond

      ((zero? m) n)

      (else (add1

            (add n (sub1

                    m)))))))


One thing I want to notice is that add1 and sub1 are not what I defined myself.

racket basic

 #lang racket


; define a constant

(define myval 3.14)


; function without param

(define myfunc

  (λ ()

    (+ 3 4)))


; call function

(myfunc)


; function with param(which is one formal)

(define myfunc-mul-two

  (λ (x)

    (* 2 x)))


(myfunc-mul-two 4)


; outer function calls inner function

(define double-result-of-f

  (λ (f)

    (λ (z)

      (* 2 (f z)))))


(define add3

  (λ (x)

    (+ 3 x)))


((double-result-of-f add3) 4)


Thursday, June 22, 2023

binary search alternative

#include <iostream>

#include <vector>


using namespace std;


int main()

{

    int array[] = { 1,3,3,4,5,5,6,9,10,12,12,15 };

    int n = sizeof(array) / sizeof(int);

    int k = 0;

    int x = 3;


    for (int b = n / 2; b >= 1; b /= 2)

    {

        while (k + b < n && array[k + b] <= x)

        {

            k += b;

        }

    }

    

    if (array[k] == x)

    {

        int a = 10;

    }

}


remainder in racket

 #lang racket


(define remainder

  (λ (x y)

    (cond

      ((< x y) x)

      (else (remainder (- x y) y)))))

Wednesday, June 21, 2023

unix tree

minnie.tuhs.org/cgi-bin/utree.pl

which on linux

which is used to locate a command. which returns the pathnames of the files (or links) which would be executed in the current environment, had its arguments been given as commands in a strictly POSIX-conformant shell. It does this by searching the PATH for executable files matching the names of the arguments. It does not follow symbolic links.

Task in UnrealEngine

 https://www.youtube.com/watch?v=1lBadANnJaw