• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

160 Neutral

About Dizzy_exe

  • Rank
  1. hash_set<Object *> (*Collisionmatrix)[Worldheight] = (hash_set<Object *> (*)[Worldheight])new hash_set<Object *> [Worldwidth * Worldheight] ;
  2. Seems Appear in Skybox

    Please try this using GL_CLAMP_TO_EDGE for your textures.
  3. deterministic physics replay

    Unfortunately, the simulation replay is a core game mechanic and cannot be implemented with keyframes. So can we please get back to the original question? I see no reason that this cannot be achieved on the same machine. From what I know, both Newton and Bullet should be capable of that.
  4. deterministic physics replay

    Hi, I am using fixed timed steps, I stopped multithreading and I recreate the scene each time I run the simulation but I still encounter those issues. I think PhysX is using a random number generator internally and there is no way to reset it. I have checked the NVIDIA forums and, from what I can tell, the problem is known and there is no workaround for this issue in the current version. I'm only interested for the simulation to be deterministic on the same machine.
  5. deterministic physics replay

    Hello, For my game I need to deterministically replay a physics simulation by reapplying the previously recorded scene inputs. Until now I was using NVIDIA PhysX, but I found out that this engine is not deterministic. So I need to change my physics engine. I'm oscillating between Newton and Bullet (both are supposed to be deterministic). My simulation uses lots of joints so I'm interested in which one is more stable. Can you recommend me which to choose? Is there a better physics engine out there which would suit my needs? Thank you.
  6. How to manage effects?

    An interesting idea would be to use conditional compiling in your shaders and have a preprocess step in which you compile a specific shader for every user effect.
  7. NAT detection

    I can think of two ways: - check if you have an adapter with a public ip and gateway - compare the ip the server sees with the ip your computer has. If they don't match, then you are behind a nat.
  8. c++ deleting current program

    You could use ProcessMonitor from Sysinternals and try to find out why the registry isn't modified. Also, are you running Vista or Windows 7? Applications do not run by default in Vista/Win7 with admin privileges even if the user is an Administrator.
  9. c++ deleting current program

    Not without mallware-like behavior. The program's image is kept open during it's execution so you can't delete it directly. What you can do: 1. write a bat which deletes the program and then deletes itself (bat files can do that) 2. Use MoveFileEx which deletes files in use on the next reboot 3. Inject yourself into another process and delete your program form there (complicated and dangerous) For 1 check this link: http://www.codeproject.com/KB/threads/HowToDeleteCurrentProcess.aspx
  10. Ultra fast search datastructure

    There is already a log(log(N)) time algorithm. Use a sorted array and do binary search on it, but instead of always selecting the middle element to do the split, try to guess the index of the searched item in the current sub-array(i.e. if you search x in an array with n elements, split the array at n * (x - array[1]) / (array[n] - array[1])). AFAIK, this is log(log(N)) time. But the speed up from log(n) is not that big.
  11. [java] Random Java Slowdowns??

    The java virtual machine probably uses the system native sleep function. On windows, this method has 10 ms granularity. Sleeps not multiple of 10 ms are rounded to 10 ms intervals. More here. I think this is the source of your issues. The rounding changes when the number of threads in use changes.
  12. unprojecting vertex with known depth

    Hi Dtag, Thank you for replying. You are right, I pass the distance from the camera to the point to UnprojectVertex. How do I get the depth from the distance?
  13. Hello all, I need a function which will take a 2D point (from a mouse click or else) and a depth value and return the corresponding 3D vertex. I managed to write a function which will give me the correct 3D position with respect to the 2D coordinates, but the depth is correct only in the center of the screen. I think I must scale the depth with the value of x and y because I use a perspective transformation, but the exact formula eludes me. Here is the code I'm using: void SetPerspectiveFovProjectionMatrix(float fov, float aspectRatio, float nearCut, float farCut) { float yScale = 1.0f / Tan(fov * 0.5f); float xScale = yScale / aspectRatio; float proj[16] = { xScale, 0.0f, 0.0f, 0.0f, 0.0f, yScale, 0.0f, 0.0f, 0.0f, 0.0f, farCut/(nearCut - farCut), -1.0f, 0.0f, 0.0f, nearCut * farCut / (nearCut - farCut), 0.0f }; m_projectionStack[m_psIndex].Set(proj); } Vector3 ProjectVertex(const Matrix4& worldProj, const Vector3& vertex, const SizeI& viewport) { Vector4 proj(vertex.x, vertex.y, vertex.z, 1.0f); proj = proj * worldProj; float halfInvW = 0.5f / proj.w; proj.x = (proj.x * halfInvW + 0.5f) * viewport.width; proj.y = (-proj.y * halfInvW + 0.5f) * viewport.height; proj.z = (proj.z < 0.0f) ? -1.0f : proj.z * 2.0f * halfInvW; return proj; } Vector3 UnprojectVertex(const Vector2& vertex, float depth, const Matrix4& invWorldProj, const Matrix4& proj, const SizeI& viewport) { float x = vertex.x * 2.0f / viewport.width - 1.0f; float y = 1.0f - vertex.y * 2.0f / viewport.height; Vector4 unproj(x * depth, y * depth, -proj[10] * depth + proj[14], depth); unproj = unproj * invWorldProj; return unproj; } An alternative solution would be to take the resulting ray and compute the required distance on the ray (compute "depth" units from source), but I'm pretty sure my problem has a solution without this hack. A big thank you for everyone who can point me in the right direction. [Edited by - Dizzy_exe on August 24, 2008 11:49:55 AM]
  14. Valve Portals: How its made?

    AFAIK, they didn't duplicate objects, the portals actually cut the geometry, which is prety cool, from a physics point of view.
  15. String performance in C++?

    In my experience, std:string performs pretty well. The only optimizations I could found in my string class were to use memcpy instead of strcpy and implement CoW (although if you are careful when writing code, you don't really need it).
  • Advertisement