Tag Info

Hot answers tagged

5

Use a 3D vector. For your 2D components, simply ignore the third component. The extra "cost" of an unused float is trivial in comparison to the rest of your architecture, and things like std::unordered_map<std:;string, Component*> are of far greater performance and memory concern than an occasionally-unused float anyway. You say that this would be ...


4

Fundamentally, "what part of the world is under my cursor" is actually a problem of collision detection -- in terms of code, there's no difference between checking what's under the cursor, and checking what part of the world was hit by a fired bullet. So, if we think of checking what's under our mouse cursor as 'firing a bullet', we're clearly firing it ...


3

3d terrain always comes with a cost: Objects get obscured behind cliffs, so the player needs to rotate the camera to maintain situational awareness. This takes time and disorients the player. They end up fighting the camera more than they fight the enemy. So before you add height levels just for the heck of it, consider how much it adds to your game in ...


3

From what I read from the shaders the light is in world-space and the light calculation is done on the object in part in untransformed object-space. You need to compute your lighting with both light & model in world-space or both in camera space. Whenever moving the camera messes up the lighting it means some of the data is calculated in a different ...


2

It depends on the implementation of the multiply operation. The internals will suppose an ordering within your matrices, row major or column major. If the ordering of your matrices is arranged the way the function expects them, then it is up to the second dpendancy: namely the respect of the correct mathematical commutativity. (which they should) When you ...


2

D3DXMatrixLookAtRh is a function for making a view matrix (scene camera analogy) which happens to be the inverse of a world matrix for an object located and rotated the same as the view matrix. So invert the result of your matrix and use the halfway point for eye, and give the function a look at position instead of a direction it is looking. pseudo code: ...


1

You are thinking of pixels as if they are some atomic structure, indivisible; they are not. Take a look at the following diagram from the Direct3D documentation on multisample rasterization:    Various triangulated objects are drawn here and the diagram shows a pixel structure with 4 samples (at fixed locations) per-pixel. Take a close look at ...


1

Try calling p.Apply() in your drawing code to set the effect correctly on the GPU before drawing. foreach (EffectPass p in drawingEngine.CurrentTechnique.Passes) { p.Apply(); // this will set the effect graphics.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, numVertices, 0, numIndices / 3); }


1

I think you and the commenters are on the right track. Ideally the hitboxes wouldn't have to be recreated on each attack (unless the nature of the attack were to change, maybe?). You could add something like this to every GameObject that can attack, along with a hitbox Collider marked as a Trigger. public class HitController : MonoBehavior { private Queue ...


1

MD2 files are just mesh frame arrays. There is no skeleton. Actions are just mesh frame sequences in the array. You can copy the character's md2 file for each weapon. Carefully replace the character mesh with a positioned weapon mesh for each action sequence frame. While labor intensive, this approach allows you to give the weapon movement much more ...



Only top voted, non community-wiki answers of a minimum length are eligible