Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About CommanderXXL

  • Rank
  1. I want to write a template functor which uses a variable argument list. I tried it with the following code: template < typename RetVal, ... Args > class CBaseFunctorBase { public: virtual RetVal Run(Args _Params) const = 0; }; this is (according to the few sources i found) the way to do it. But my visual studio 2008 does not compile it. I get "C2059: syntax error: '...'" Is it possible that microsoft does not support this c++ conform template ellipsis parameters? If anyone knows another solution to my problem please post it. Thanks
  2. CommanderXXL

    Impact of two moving spheres?

    Hi, i have a little problem with some collision algorithm. I have two colliding objects with a center and a radius that both have different vectors they're flying and different radiuses. I can't find the correct forumula for the elastic impact of both spheres. I do the calculations only in R2 (Two Dimensions X/Y). I tried the formula for the impact of just one moving object, but even this seems to be wrong as the radiuses are different. Here is what i have as inputs: Vector2D DirectionOfSphere1; Vector2D DirectionOfSphere2; Vector2D ImpactPoint; //(where both spheres collide) float RadiusOfSphere1; float RadiusOfSphere2; The masses are calculated from the radiuses. It would be great if someone of you math gurus came up with a formula i can use to get the Vectors of both spheres after the collision Thanks CommanderXXL
  3. Do you generate Tangents in your Code with some call to ComputeTangentFrame? When yes, you have to get the VertexRemapData from the call to ComputeTangentFrame and then feed this data in the skininfo object with "Remap". The Remaping has to be done for each of the calls that feature a vertex remap output like: "CleanMesh", "ComputeTangents", "ComputeNormals" and so on. Also possible would be a cloning of the original mesh (Your "mMeshContainer->MeshData.pMesh") if you do this and you change the vertex layout then you have to set your Vertex Layout on your skininfo object using "SetDeclaration". The best method is this: D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]; mMeshContainer->MeshData.pMesh->GetDeclaration(Declaration); skin->SetDeclaration(Declaration); with this your are save cause you are using the right vertex declaration. If you clone your using the CloneFVF method, i suggest to use the declaration method, cause there is a known bug in the CloneFVF method of DirectX with special vertex declarations. The cloning with Vertex Declarations is also more flexible than the FVF one. I hope i could help you
  4. Hi, i want to use this great exporter for some Models within my Game Project. The Issue i have is, that it is not possible to just export Animations. I have all my Animations in separate Max Files and just want to export each of em into a X-File. Additionally i have a Skinned Model which is in a separate File. This is not a big problem, but makes the X-Files with just the animations unnecessarily big. Maybe you could implement a simple Check Box "Export Geometry" and if this is unticked i just get the Animation Sets in the X-File. This would be realy great. Thanks CommanderXXL
  5. CommanderXXL

    Direct3D10 Development

    Hmm, this all sounds quite understandable to me, but this practice is not very developer friendly. Especially those devolopers who don't develop games for millions of buyers, persons like me, who just want to make games for fun and for free to some people that want it. Ageia with their PhysX SDK just did the right thing: they allow almost anybody to get und use their physic sdk for free. I see the point i not sending beta graphis boards to small developers, but it would at least be nice to make the beta drivers available for anybody the same day the hardware is in stores for normale people. Today NVidia released the General Purpose SDK for their new G80 and again just for registered developers. In the form where you can register as developer you have to fill in even which game you are currently working on and when it is to ship in retail packages. Students like me, who just have fun writing games or some usefull tools which take advantage of new technologies are "not supported". I hope that there will be a vista driver for the G80 soon and i hope the general purpose sdk for the g80 will be released to normal persons someday. Thanks for reading my thoughts Greetz CommanderXXL
  6. Hi, i have a very simple question: How is it possible that game companies like crytek can develop games for direct3d version 10? I have a GeForce 8800 GTX since today and wanted to port my 3d engine to the new direct3d version just to find out that there are no drivers for windows vista for my card. I have Vista RC1 installed just for this purpose and i downloaded the latest direcx sdk (October 2006) with Direct3D10 preview in it, but i have a no go for a direct3d10 driver for this graphics board. But Crytek seems to have developed their crysis engine for the new system long ago. How is this possible? Did they have access to hardware and drivers since many month now? If so, why does NVidia not release this driver now that the Hardware is finaly available to customers? I hope someone can answer this questions to me, since i desperatly want to use the new direct3d 10 features i my engine. I have many very good ideas and want to start implementing these using the new geometry shaders. Greetz CommanderXXL
  7. Hi, i have a little problem with my portal culling. Currently i recreate my frustum from my portals in a very simple way. I clip the portal to all my planes in frustum and then rebuild my frustum with this clipped portal for the further lookups in the areas on the other sides of the portal. My portal clipping works fine, but i have some difficulty with the method of adjusting my frustum to the new portal. I use this code right now: CFrustum BuildNewFrustum(const CVector3D& CamPos) const { CFrustum Frustum; // Walk all edges of the portal for(unsigned int aktPoint1 = 0; aktPoint1 < Points.size() - 1; ++aktPoint1) { // Build a plane from two points of the edge and the camera pos CPlane Plane(CamPos, Points[aktPoint1 + 1], Points[aktPoint1]); Frustum.AddPlane(Plane); } // The last plane is the one from last point of portal to first point CPlane Plane(CamPos, Points.front(), Points.back()); // Add plane to frustum Frustum.AddPlane(Plane); return Frustum; } This code has some serious problem with the normal of the generated planes. Some of it are fine, the others face the wrong direction and therfore clip the wrong protion of the geometry for the next area. The second problem i have, is that i have no idea on how to find out which planes in my frustum are obsulete due to more restricting ones. Can you please tell me some good and robust way of adjusting my frustum to my portals? Thanks for Help Greetz CommanderXXL
  8. CommanderXXL

    new call in other heap than delete call?

    Thanks for your ultra fast help. I switched my runtime to the dll version and it works like a charm. Thanks again
  9. Hi, i have a problem with memory allocation in my game engine. I try making a plugin system for my level loaders. The problem is, that this loader dlls create many structures using new calls like "Renderer->AddLight(new MovingLight(...));" this is neccesary cause my loaders use derived classes and just pass pointers of the base classes to the Renderer. Since each loader is a dll of it's own i get a problem when i delete theses classes at cleanup. The loader dll does not unload its structures the renderer does and since that is another dll i get exceptions from windows (Heap protection) when i call delete on the classes from the renderer. Is there a way to tell windows that i want another dll to manage the classes created than the one which created 'em? Thanks for your help.
  10. Hi, i got a problem with my vertex sorting in my polygons. I need to have clockwise ordered vertices for my triangulation code to work. So i assume the problem is within my sorting code. Maybe you can find the problem of my sorting code. If you have a simpler or better performing code for sorting polygons clockwise i would also appreciate to see it. void SortClockwise() { // Get center of polygon CVector3D Center(GetCenter()); for(unsigned int aktVert1 = 0; aktVert1 < Vertices.size() - 1; ++aktVert1) { CVector3D Pos1(Vertices[aktVert1].Position); CVector3D A(Pos1 - Center); A.Normalize(); // Create a plane thru current vertex, center and normal of polygon CPlane Plane(Pos1, Center, Center + Normal); float SmallestAngle = -1; int Smallest = -1; for(unsigned int aktVert2 = aktVert1 + 1; aktVert2 < Vertices.size(); ++aktVert2) { CVector3D Pos2(Vertices[aktVert2].Position); // Test against plane if vert can be the next if(Plane.ClassifyPoint(Pos2) == CP_Front) { CVector3D B(Pos2 - Center); B.Normalize(); float Angle = A.Dot(B); if(Angle > SmallestAngle) { SmallestAngle = Angle; Smallest = aktVert2; } } } // Vert with smallest angle is the next if(Smallest != -1) { // Tauschen der Vertices CVertex Temp(Vertices[aktVert1 + 1]); Vertices[aktVert1 + 1] = Vertices[Smallest]; Vertices[Smallest] = Temp; } } // Reverse vertices if needed CVector3D P1(Vertices[0].Position); CVector3D P2(Vertices[1].Position); CVector3D P3(Vertices[(unsigned int)Vertices.size() - 1].Position); CVector3D AB(P2 - P1); CVector3D BC(P3 - P1); CVector3D Norm(AB.Cross(BC)); if((Normal.Dot(Norm)) < 0) { vector <CVertex>::iterator B,E; B = Vertices.begin(); E = Vertices.end(); for(unsigned int i = 0; i < Vertices.size() / 2; ++i) { --E; CVertex TempV = *E; *E = *B; *B = TempV; ++B; } } } Thanks for any help
  11. CommanderXXL

    Managing Game Interface Pointers

    Thanks for your quick answers. I got the idea of both your suggestions and i think i will implement a mix of both. I have indeed a message system basend on my CComServer online and the server is able to track the graph with all dependecies of the modules as it gets notified when a module starts and quits. And when such a module is registering one of it's smart pointers there is always the owner of this pointer stored in it and therefore the server knows which module depends on which others. I think i'll try using some sort of callback mechanism which gets called by the smart pointers in the owner module, which will then trigger the commands required when loading a new module.
  12. CommanderXXL

    Input timing

    I guess you are not using Direct Input? So if you are using the WM_KEYDOWN and WM_KEYUP messages of windows the simplest methode would indeed be a timer. have a bool for each of the keys you need and set it to true in your WM_KEYDOWN handler, set it to false in your WM_KEYUP handler and move your parts based upon the bools in the WM_TIMER handler. If you implement more levels in your game you can simply modify the Timer interval to your new game speed. Tetris is perfectly fine with the normal windows timer, cause the intervals are big enough. For high speed game timing you should use other timing methods instead.
  13. Hi, i have a really tough problem in my Game Design: My Engine is based upon a server like master class called CComServer. Ths is the Main module which loads at startup. All other modules are in separate DLL files, one for each interface i need, so there are: Renderer (2 different of these), Sound (2 different), logic (this is the complete game logic which controls the actors, or when there is a video to play), WorldManager (this module uses another style of dlls which locate loaders for different world formats like quake3, doom3 and so on.) and input (based upon direct input) there are more but these are most important ones. Each of these Modules is derived from a class called CComClient. Each "Client" registers itself at the ComServer at startup and logs itself out of it when the dll ist unloaded (At Game End mostly). There is no given startup sequence for this modules. They load all at the same time with multiple threads for doing so. Now my Problem is the following: Some modules depend on others, for example the input interface can do nothing without a window from which to get the input an this is handled by the renderer interface. I used to have a method in my ComServer from which i could get the Interface Pointer to a module. But now i want these modules to be able to dynamically load or unload during runtime (to switch renderer from direct3d to opengl for example) this would require that all modules which depend on this switched module would get some sort of notify that their dependent module is no longer available and later upon the completition of loading the replacment module get another notification that now there is a new module which needs all setup work needed to be done again by the using module. I have now implemented a class which is some sort of smart pointer to the interfaces. This class is able to maintain the pointer to the interface. It gets set to Null when a module is unloaded and it gets the new pointer when the new module is loaded again. So far so good. But now i want this "Notification" thing so that the module which holds such a "smart pointer" is able to know when it can go to sleep and when it needs to setup its required modules again. Do you have any good suggestions on how i can accomplish this so that it is well integrated in the given environment? Thanks for reading this long post and more thanks for giving me a good advice *g*
  14. CommanderXXL

    Free Image Loader Library?

    Yeah, Corona was my choice. Since it is realy easy to load Images and specify the it Format. Where can i get this "Patch" since i never used a cvs i do't know how to access files. Do i have to compile the DLL myself if i fetch the cvs code?
  15. CommanderXXL

    Free Image Loader Library?

    Thanks for all your help. I will look into all of them and take the one which is the simplest one to implement.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!