Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 19 Mar 2007
Online Last Active Today, 06:47 AM

Topics I've Started

Window Docking System

16 June 2012 - 03:44 PM

Hello there fellow GameDev citizens. How are you doing this fine evening? How's it going with your work on your awesome engines and demos and games?

I'm STUCK! I've been working on a docking system for use with Win32 applications, very much inspired by that used in Visual Studio. Such a system should be very useful for editor-type applications which is exactly what I'm going to be using it for. I've made good progress - have a look at this video here if you will:

I'm quite comfortable working with the Win32 GUI API, so I'm not really stuck on something technical, but rather on the design of the thing. Currently a tree structure keeps track of the windows' layout. What I'm stuck on is implementing the behavior of restoring a window to its previous position after it has been hidden or otherwise removed from the layout tree. This is the same issue of implementing the behavior of restoring the layout from file at startup or applying a certain layout in certain application operation modes and then restoring a previous layout.

For example, at 0:29 in the video, we have a floating "pane" which has two windows docked inside it. Once one of these windows is undocked, the pane is left with just one window docked inside it, making it a redundant pane, so the remaining window is undocked and the empty pane is removed. In VS, if the user hides one of these two windows, and then shows it again through the View window, the window is put back where it was and a pane is created again. So I guess my question is what would be the best way to represent the placement of a window, and how to use that representation when removing and restoring windows into the layout tree? Or maybe I'm thinking about this whole thing in the wrong way. Any thoughts are welcome.

If anybody has any experience with such a system in a different language or environment, I'd appreciate it if they would shed some light on how it's done there.

Scene::CreateEntity() vs. Scene::InsertEntity()

26 January 2012 - 04:12 AM

Hi. Consider an extensible entity system for an engine. Using
Entity* Scene::CreateEntity( unsigned EntityTypeID )
results in easier memory management. The engine creates all entities that it will use, and will delete them when appropriate. However, this requires an interface for registering entity factories for all entity types. In addition, it becomes nearly impossible without unsightly hacks to add and remove entities into and out of scenes for, say, streaming purposes and editor undo/redo functionality.

On the other hand, using
VOID Scene::InsertEntity( Entity* )
VOID Scene::RemoveEntity(Entity*)
allows us to get rid of the EntityTypeID and factory stuff, but we're left with the problem of memory management for the entities. The first solution that comes to mind now is using smart pointers, but unfortunately template classes can not be used in an API for binary-distributed libraries like an engine. What are your thoughts?

MayaFPS: First Person Camera Plugin For Maya

23 September 2011 - 09:13 AM


MayaFPS is a plugin for Autodesk® Maya® which implements first person camera controls. The plugin allows controlling the perspective camera in Maya using traditional first person shooter controls (WASD for movement, mouse to look around). This is very useful and saves a lot of time for a lot of scene types, like game levels and architectural walkthroughs for example.



Here is a list of features that the plugin implements.

  • Traditional first person shooter controls using WASD. First person controls are engaged when you click and hold the right mouse button (RMB).
  • Keyboard modifiers for controlling the activation of first person controls. You can use any combination of CTRL, SHIFT, ALT, and the Windows Logo (WIN) key as modifiers (the default uses no modifiers at all).
  • If no keyboard modifiers are used, Maya's Marking Menu (the menu which normally shows up when you right-click the viewport) can still be easily accessed by tapping the left mouse button (LMB) while RMB is down. Once you get used to this, you will find that it's easier and faster than using keyboard modifiers.
  • Highly adjustable - tweak the plugin settings until it feels just right. Movement speed can be adjusted on the fly using the mouse wheel. Mouse sensitivity can also be adjusted using keyboard shortcuts.
  • Adjustable mouse smoothing parameters - the default settings are ideal for regular usage, but cranking the smoothing parameters higher makes rotations so smooth that recording a pleasant fly-through may no longer require key-framing the camera.
  • Ability to lock the camera movement across the horizontal plane to simulate walking instead of flying. To constrain the camera movement across the horizontal plane, simply toggle the CAPS LOCK key on. Toggle it off to free the camera.
  • Easy and intuitive user interface for modifying plugin settings.
  • Automatic updates notification. By default, the plugin will check for updates every time it's loaded in Maya.
  • Very low resource usage.

Please visit the plugin homepage for a free demo version or to purchase the full version. Thank you.

Many template function arguments

01 March 2010 - 08:38 AM

Hello everyone. I have a rather simple problem and I thought maybe there is something I'm missing that would help me with it. I have a function that loops over a number of objects and doe some calculations and modifies them, and I'd like to keep that function fast, so I made it a template function with template bool parameters that control whether certain calculations are performed or not. Here:
template <bool bPreserveCorners, bool bSmoothPositions, bool bSmoothThickness, bool bSmoothMasking>
VOID SmoothCurve( CSmoothTool* pSmoothTool, CCurve* pCurve, INT nKernelSize, TCurveNode* pFirst, TCurveNode* pLast )

The problem is the complexity of the code that determines the template arguments to pass to this function. How can I pass the boolean variables as template arguments without creating a complex if tree? Truth be told, I will actually just use only one template argument (bPreserveCorners in this case) since using four would result in 16 versions of the function being instantiated and linked, and since the performance gains from templating the other 3 boolean arguments is in practice insubstantial and unnecessary, but I still would like to know if there is an easy way to approach this. Thanks in advance.

DX9: [D3DXEFFECT] Global bools in conditionals

04 January 2010 - 11:18 AM

Hello, how are you doing? If I do something like this in an effect file:
bool   g_bBlackness;

// ..... stuffs....

float4 AwesomenessPixelShader()
    if( g_bBlackness )
       return float4( 0, 0, 0, 1 );

    // ... do potentially complex computations here

    return Potentially_Complex_Computation_Result;

Question is, will the effect compiler create two separate versions of the pixel shader and invoke the right one based on the value of g_bBlackness set by the application? If not, is there a way to create something like a template argument that would result in creating all the different possible versions without actually using conditionals? Thanks in advance.