Actors are now in place and working correctly. I actually made a small mistake yesterday and made meshes part of the actor. This incorrect because a mesh should extend an object and be it's own actor type (i.e. class EMesh : public EActor{};). This is fixed and therefore the actor creation has slightly changed, but the shortcut (EActor::Add("ActorName", "mesh.gmf")) still works as expected.
Timer
I need to start adding actors so there are multiple in-game types of entities. First, I need a timer, because I just love timers. Even if it was just a single timer I'd be happy. They are extremely useful.
ETimer::SetTimer(1.0f, TRUE, FUNCTION);
A better example:
// .. function to execute by the timer void TickSpecial(void) { printf("Tick Special\n"); } // .. looping timer Timers.SetTimer(1.0f, TRUE, TickSpecial); // .. void EGame::Unload(void) { Timers.StopTimers(); }
There is still more I want to add to the timers but this is a good start. I'd also like to move them to threads to support multiple timer tasks.
Cameras
Cameras are interesting and always seems to be a topic around Werkspace. Cameras in this engine/framework are Actors and this should be interesting. Since cameras will extend actors I already have translation and rotation.
// .. automatically done but an example[/i] - 0 is the framework camera layer to fetch Cameras.Add("Camera_1", 0); Cameras.Rotate("Camera_1", vec4(0.0f, 1.0f, 0.0f));
Next was to just add helper functions that are provided by LE, such as zoom, project, unproject, etc:
// zoom with interp Cameras.SetZoom("Camera_1", 1.0f, 1.0f); // project vector project = Cameras.Project(vec3(MouseX(), MouseY(), 1000.0f);
I shouldn't have a problem from here having any type of camera "mode" I would like to have. I will begin working on these once I get to detailed mechanics.
Cameras are now working, along with timers, and now it's time to take a break. I may keep pushing forward but shortly I have to return to my other projects until I have time to return.
Until next time, and thanks for reading.
2 Comments
Recommended Comments