void UAnimSingleNodeInstance::SetVertexAnimation(UVertexAnimation * NewVertexAnim, bool bIsLooping, float InPlayRate)
{
	if (NewVertexAnim != CurrentVertexAnim)
	{
		CurrentVertexAnim = NewVertexAnim;
	}

	if (USkeletalMeshComponent * MeshComponent = GetSkelMeshComponent())
	{
		if (MeshComponent->SkeletalMesh == NULL)
		{
			// if it does not have SkeletalMesh, we nullify it
			CurrentVertexAnim = NULL;
		}
		else if (CurrentVertexAnim != NULL)
		{
			// if we have an anim, make sure their mesh matches, otherwise, null it
			if (MeshComponent->SkeletalMesh != CurrentVertexAnim->BaseSkelMesh)
			{
				// clear asset since we do not have matching skeleton
				CurrentVertexAnim = NULL;
			}
		}
	}

	bLooping = bIsLooping;
	PlayRate = InPlayRate;

	// reinitialize
	InitializeAnimation();
}
Ejemplo n.º 2
0
void Minion::Initialize(char* path, char* filename)
{
	SkinnedMesh::Initialize(path, filename);
	InitializeAnimation();
	position = initialPositon;
	sight_wide.radius = 70.0f;
	sight_narrow.radius = 20.0f;
	attackSphere.radius = 5.0f; 
}
Ejemplo n.º 3
0
//ÃʱâÈ­ ÇÔ¼ö
//ÆÄÀÏ ·Îµå
//¾Ö´Ï¸ÞÀÌ¼Ç À̸§, ¹øÈ£¸¦ ³Ö´Â ¾Ö´Ï¸ÞÀÌ¼Ç ÃʱâÈ­
//HP, ÆÇÁ¤(¹Ù¿îµù º¼·ý) ÃʱâÈ­¸¦ ¼öÇà
void Player::Initialize(char* path, char* filename)
{
	SkinnedMesh::Initialize( path,  filename);

	InitializeAnimation();
	forwardBoundingSphere.center = boundingSphere.center;
	forwardBoundingSphere.radius = boundingSphere.radius;
	
	hp = 100;

}
Ejemplo n.º 4
0
// Create the window, show it.
HRESULT FirstTry::Initialize()
{
	HRESULT hr = CreateDeviceIndependentResources();

	if (SUCCEEDED(hr))
	{
		// Register the window class
		WNDCLASSEX wcex = { sizeof(WNDCLASSEX) };
		wcex.style = CS_HREDRAW | CS_VREDRAW;
		wcex.lpfnWndProc = FirstTry::WndProc;
		wcex.cbClsExtra = 0;
		wcex.cbWndExtra = sizeof(LONG_PTR);
		wcex.hInstance = HINST_THISCOMPONENT;
		wcex.hbrBackground = NULL;
		wcex.lpszMenuName = NULL;
		wcex.hCursor = LoadCursor(NULL, IDI_APPLICATION);
		wcex.lpszClassName = L"FirstTry";

		RegisterClassEx(&wcex);

		// Obtain the system DPI
		float dpiX, dpiY;
		m_pD2DFactory->GetDesktopDpi(&dpiX, &dpiY);

		// Create the window
		m_hwnd = CreateWindow(L"FirstTry", L"First Try", WS_OVERLAPPEDWINDOW,
			CW_USEDEFAULT, CW_USEDEFAULT, static_cast<UINT>(ceil(640.f*dpiX / 96.f)), static_cast<UINT>(ceil(480.f*dpiY / 96.f)),
			NULL, NULL, HINST_THISCOMPONENT, this);

		hr = m_hwnd ? S_OK : E_FAIL;
		if (SUCCEEDED(hr))
		{
			// Initialize Animation.
			hr = InitializeAnimation();
			if (SUCCEEDED(hr))
			{
				hr = CreateAnimationVariables();
				if (SUCCEEDED(hr))
				{
					ShowWindow(m_hwnd, SW_SHOWNORMAL);
					UpdateWindow(m_hwnd);
				}
			}
		}
	}

	return hr;
}
Ejemplo n.º 5
0
HRESULT CMainWindow::Initialize(
    HINSTANCE hInstance
    )
{
    // Client area dimensions, in inches
    const FLOAT CLIENT_WIDTH = 7.0f;
    const FLOAT CLIENT_HEIGHT = 5.0f; 

    HRESULT hr = CreateDeviceIndependentResources();
    if (SUCCEEDED(hr))
    {
        // Register the window class

        WNDCLASSEX wcex = {sizeof(wcex)};
        wcex.style         = CS_HREDRAW | CS_VREDRAW;
        wcex.lpfnWndProc   = CMainWindow::WndProc;
        wcex.cbWndExtra    = sizeof(LONG_PTR);
        wcex.hInstance     = hInstance;
        wcex.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
        wcex.hCursor       = LoadCursor(NULL, IDC_ARROW);
        wcex.lpszClassName = L"WAMMainWindow";
        
        RegisterClassEx(&wcex);

        // Because CreateWindow function takes its size in pixels, 
        // obtain the DPI and use it to calculate the window size.

        // The D2D factory returns the current system DPI. This is
        // also the value it will use to create its own windows.

        FLOAT dpiX, dpiY;
        m_pD2DFactory->GetDesktopDpi(
            &dpiX,
            &dpiY
            );

        // Create the CMainWindow window

        m_hwnd = CreateWindow(
            wcex.lpszClassName,
            L"Windows Animation - Priority Comparison Demo",
            WS_OVERLAPPEDWINDOW,
            CW_USEDEFAULT,
            CW_USEDEFAULT,
            static_cast<UINT>(dpiX * CLIENT_WIDTH),
            static_cast<UINT>(dpiY * CLIENT_HEIGHT),
            NULL,
            NULL,
            hInstance,
            this
            );
        hr = m_hwnd ? S_OK : E_FAIL;
        if (SUCCEEDED(hr))
        {
            // Initialize Animation

            hr = InitializeAnimation();
            if (SUCCEEDED(hr))
            {
                // Display the window
                ShowWindow(m_hwnd, SW_SHOWNORMAL);
                UpdateWindow(m_hwnd);
            }
        }
    }

    return hr;
}
Ejemplo n.º 6
0
void Bomb::Initialize()
{
    InitializeGeometry();
    InitializeAnimation();
}
Ejemplo n.º 7
0
void Fire::Initialize()
{
    InitializeGeometry();
    InitializeAnimation();
}