Jump to content

No Shadow with Pivot Parent


Go to solution Solved by Josh,

Recommended Posts

Posted

I think I may have addressed this before but can't remember... an entity will not cast a shadow if it has a pivot as a parent.

#include "UltraEngine.h"
using namespace UltraEngine;


int main(int argc, const char* argv[])
{
    auto displays = GetDisplays();
    auto window = CreateWindow("Ultra Engine", 0, 0, 800, 600, displays[0]);
    auto world = CreateWorld();
    auto framebuffer = CreateFramebuffer(window);

    auto camera = CreateCamera(world);
    camera->SetClearColor(0.0f, 0.0f, 1.0f);
    camera->SetFov(70);
    camera->SetRange(0.01f, 1000.0f);
    camera->SetPosition(0, 1, -3);

    auto light = CreateDirectionalLight(world);
    light->SetColor(5.0f);
    light->SetRotation(35, 45, 0);

    auto floor = CreateBox(world, 100.0f, 0.1f, 100.0f);

    auto pivot = CreatePivot(world);

    auto box = CreateBox(world);
    box->SetParent(pivot);
    pivot->SetPosition(0.0f, 2.0f, 0.0f);

    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
    {

        world->Update();
        world->Render(framebuffer, false);
    }
    return 0;
}

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...