Core Engine Part 2

Yesterday I got the View class up and running, and replaced any an all vector transformations in my rendering engine to an object's world-coordinate matrix.

Now the job is to figure out how to communicate said transformations at the lower level, where things like object picking can be possible. The logic can be summarized at the moment into this:

if(raycast intersects an interactive entity){
    if(stack is empty)
          -> Push start point and endpoint of ray to stack FIRST_CLICK
    else if(stack == 1 && stack != 2)
          -> Push start point and endpoint of ray to stack SECOND_CLICK
    else
          -> empty stack}
else
    ->empty stack

The problem is, that the first if() condition make this method not really belong in the View class, which should only be responsible for input, not specific information about how to interpret the input, which is specific to the game. As a result, this method will belong to some Game class.

Comments

Popular posts from this blog

Core Engine Part 1

First Post