Jump to content

Roland

Members
  • Posts

    2,953
  • Joined

  • Last visited

Posts posted by Roland

  1. This is so weird that I do hesitate to tell it.

    The shadow problem suddenly went away.

    I added a pointlight into the scene for some test and then removed it so the scene became same as shown.

    Now to the spooky thing. The shadow artifacts are gone. Same scene, same lighting, same settings..... ;)

     

    So good for now ... eeeh... I think ;)

  2. is it just on that one rock? in the video it didn't look like the other rocks had that issue... if its just that one rock maybe something with the material's specular texture or the model itself?

    I moved the stones a bit from each other and the shadow problem exist on all of them.

    Tested in another engine and no problems there. I will go through my models and materials another time though.

    Thanks for the suggestion

  3. Yes. That's another way to achieve same effect.

     

    However, a singleton gives you control over when the class is instantiated. A static class is less controllable and is instantiated before main is called.

     

    The sequence in which classes is instantiated can sometimes be critical when the singleton depends on some other class or resource which is not available before main is called.

  4. A Singleton is a class which will only have one and only one instance in your project. The Singleton can be accessed from anywhere.Here is how to make a Singleton class:

     

    class MySingleton
    {
    private:
     MySingleton() {} // Prevent users from making instances
    
    public:
    static MySingleton& instance() // returns the one and only instance
    {
    	 static MySingleton instance;
    	 return instance;
    }
    
    void SayHello()
    {
    	 System:Print( "Hello");
    }
    };
    

     

    Now you can use it anywhere in any project file like this

     

    MySingleton::instance().SayHello();
    

    • Upvote 1
  5. Aggrors (Jorn) website.

     

    Aggror.com

     

    I book marked Roland's C++ you tube channel. I haven't watched it yet ( still getting to grips with LUA ) but should be of some help.

     

    http://www.youtube.com/playlist?list=PLD9BT6X6Eefz3omHi4q8s2vtLhBbdv-ql

     

    Those tutorials are about general C++ programming aimed towards Leadwerks. I was planning of doing more of them but didn't because there was very few viewers. However if you are totally new to C++ its a good start as start assuming you know absolutely nothing. I talk quite slowly as English is not my native language.

  6. Can self.component:CallOutput( "something" ) give a return value ?

    Means that the in-function returns a value that is passed to the CallOutput return

     

    Lua1.lua

    --------------------------------------------------------------------------------

    function Script:func()

    local retval = self.component:CallOutput( "something" )

    System:Print( retval ) -- prints "Hello" ?

    end

     

    Lua2.lua

    ---------------------------------------------------------------------------------

    function Script:something()--in

    return "Hello"

    end

    • Upvote 1
×
×
  • Create New...