티스토리 툴바



새로 생성된 파생 클래스 객체에 대한 기본 클래스 포인터를 반환하는 함수.


class TimeKeeper
{
public:
 TimeKeeper(void);
 virtual ~TimeKeeper(void);
};

// 시간 계산이 어떻게 되는지 몰라도 시간 기록을 유지하기 위한 클래스들.
class AtomicClock : public TimeKeeper
{
public:
 AtomicClock(void)
 {
  cout<<"Atom"<<"\n";
 }
 ~AtomicClock(void){};
};

class WaterClock : public TimeKeeper
{
public:
 WaterClock(void)
 {
  cout<<"Water"<<"\n";
 }
 ~WaterClock(void){};
};

class WristWatch : public TimeKeeper
{
public:
 WristWatch(void)
 {
  cout<<"Wrist"<<"\n";
 }
 ~WristWatch(void){};
};

// 시계 생성 기본 클래스
class ClockMaker
{
public:
 // 새로 생성된 파생 클래스 객체에 대한 기본 클래스 포인터를 반환하는 함수.
 TimeKeeper* GetClock(string& name)
 {
  TimeKeeper* timeKeeper = MakeClock(name);
  // 이런저런일을 하자꾸나.
  return timeKeeper;
 }

protected:
 virtual TimeKeeper* MakeClock(string& name)=0;
};

class TimeClockMaker : public ClockMaker
{
public:
 // name에 따라 원하는 파생형으로 만들어서 반환.
 TimeKeeper* MakeClock(string& name)
 {
  TimeKeeper* timeKeeper = NULL;
  if(string("Atomic") == name)
  {
   timeKeeper = new AtomicClock;
  }
  else if(string("Water") == name)
  {
   timeKeeper = new WaterClock;
  }
  else if(string("Wrist") == name)
  {
   timeKeeper = new WristWatch;
  }
  return timeKeeper;
 }
};

int _tmain(int argc, _TCHAR* argv[])
{
 TimeKeeper* waterClock = NULL;
 TimeClockMaker* maker = new TimeClockMaker;

 string clockName = "Water";
 waterClock = maker->GetClock(clockName);
 return 0;
}

저작자 표시 비영리 변경 금지

'Programming > C++' 카테고리의 다른 글

factory function (팩토리 함수)  (0) 2012/05/12
Hash 함수 모음  (0) 2011/04/22
boost::has_trivial_assign  (0) 2011/04/10
메모리맵 파일  (0) 2011/04/09
LIB / DLL 차이점  (0) 2011/03/17
How to convert std::string to TCHAR*  (0) 2011/01/06
Posted by 붕대마음
이번에 kasa에서 발표할 주제는 AA.
Sampling 내용 절반에 AA관련 내용 절반.
아...pt만들기 힘들었어...ㅜㅜ....

저작자 표시 비영리 변경 금지

'작업장 > 발표하기' 카테고리의 다른 글

Anti Aliasing  (0) 2012/05/03
StencylWorks 발표  (0) 2011/07/01
부게게 스터디 발표. - 빛 기초.  (2) 2011/05/29
발표준비 - 라이팅  (0) 2011/05/20
kasa study ssao 발표자료  (0) 2010/12/06
Collada 발표 (참고자료)  (0) 2010/11/28
Posted by 붕대마음

케릭터 돌리는 함수.
Controller.Pawn.SetRotation(CharacterRot);

관련된 다른 함수들.
Controller.Pawn.SetDesiredRotation(ViewRotation);
Controller.ProcessViewRotation( DeltaTime, ViewRotation, DeltaRot );
Controller.SetRotation(ViewRotation);
Controller.Pawn.FaceRotation(NewRotation, DeltaTime);
저작자 표시 비영리 변경 금지

'Unreal > Unreal Script' 카테고리의 다른 글

케릭터 돌리기  (0) 2012/03/22
내가 만든 소스 넘겨주기.  (0) 2012/02/28
unreal project 참조 만들기  (0) 2012/02/21
게임모드 끼워넣기  (0) 2011/12/08
Particle, SoundCue 추가방법  (0) 2011/11/24
뮤테이터(Mutator) 끼워넣기  (0) 2011/11/18
Posted by 붕대마음