• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

124 Neutral

About thedo

  • Rank
    Advanced Member
  1. Quote:1) They are not all from Unity game engine editor, check here for info: http://en.wikipedia.org/wiki/ModGrafix_Engine_XM-F I see you've gone to the effort of putting up a wikipedia page too. Excellent work. Now where's my chequebook?
  2. Quake 3 collisions

    The reason i chose such a small number was to ensure I actually hit the plane and wasnt going through fully in 1 frame. I'm pretty sure I'm doing something wrong somewhere (obviously), however its just pretty hard to debug it as i can only test "virtually" - ie other than getting no feedback from hitting the ground its pretty hard to determine why without stepping through a *lot* of times! Cheers for your advice! N
  3. Quake 3 collisions

    Well, the trace method takes a start point and an endpoint, so i was doing something like Vector3 position = cameraPosition; //Gotten though inverting the view and getting the translation Vector3 newPosition = position+velocity; my velocity would be say, 0,-0.1,0 - which means that the endpoint isnt equal to the startpoint. I know a linear velocity for gravity isnt exactly realistic, but hey, I'd rather make it realistic once its working! This also in this case doesnt really explain why so much work is done when the endpoint==startpoint as this doesnt actually happen! N
  4. Quake 3 collisions

    Well, what a long morning of trying to understand code. I finally got something running - I basically managed to get by by always assuming a bounding sphere, and converting the following methods CM_Trace, CM_PositionTest, CM_TraceThroughLeaf, CM_TraceThroughBrush, CM_TraceThroughTree, CM_TestInLeaf and CM_TestBoxInBrush, and CM_BoxLeafNums_r. I'm at a bit of a loss why it does so much work when there is no velocity - I'd assume that if you havetnt moved that the game could assume that you were in a valid area and just let you keep the position, but apparently not - can anyone shed any light? As per usual, Its not perfect - probably due to parts ive incorrectly translated - as i still havea couple of walls i can walk thorugh and some invisible walls still. Still no collision with the floor either - should there be? Anyways, thanks for the help so far! N
  5. With the memory stream did you seek back to the beginning? If you didnt then you could have had this (Shoddy diagram) <xml>Some random Node</xml> ^ current position of memory stream is at end of stream, so when you call xmlDocument.Load(memoryStream); its correct - there is no root element, because theres nothing after the current position in the stream. So bewfore the load call try: memoryStream.Seek(0,SeekOrigin.Begin); and maybe that would work. In theory anyways....... N
  6. Quake 3 collisions

    Thanks for the info. Ive converted the source to VS2005 poject and its compiling now - I'm not planning on running it right now, but just using VS to allow me to navigate the structures more easily than Textpad. Cheers N
  7. Quake 3 collisions

    I actually tried that code, but couldnt get it to work properly. I didnt manage to get wall collsions working, but not floor collision. I downloaded the Q3 source earlier, but i was a little overwhelmed- your link to where to find the code should be most helpful. N
  8. Quake 3 collisions

    Ive got a fully working Q3 renderer up and running in XNA and wanted to try to get some collision going. I looked about on tih forum and didnt find much, so I knocked this up Vector3 CheckCollision(Vector3 position, Vector3 velocity) { BSPLeaf leaf = DetermineCurrentLeaf(); for (int j = 0; j < leaf.n_leafbrushes; j++) { BSPLeafBrush leafBrush = LeafBrush[leaf.leafbrush + j]; BSPBrush brush = Brush[leafBrush.brush]; for (int k = 0; k < brush.n_brushsides; k++) { int plane = BrushSide[brush.brushside + k].plane; float dot = Vector3.Dot(position-velocity, Plane[plane].normal) - (Plane[plane].dist); dot = Math.Abs(dot); if (dot <5) { velocity = new Vector3((float)Math.Acos(Plane[plane].normal.X)*velocity.X, (float)Math.Acos(Plane[plane].normal.Y) * velocity.Y, (float)Math.Acos(Plane[plane].normal.Z) * velocity.Z); } } } position =position- velocity; return position; } Now I should point out now that my maths isnt great, so theres probably lots to pick apart here! Now What i seem to get it I collide against most some of the rendered walls as i expect, but also hit a few impassible ones too. Basically I get down to the plane level of the BSP (I assume I'm doing it correctly), and then dot the new position against the plane. If it is <5 (the radius of my bounding sphere), then I alter the velocity to the ACos of the normal of the plane. The reason for this is that if the normal of the plane is 0,1,0 then acos of that would be 90,0,90 which would indicate that i cant move in the Y direction. So 1: Does anyone know how to avoid the invisible planes (ie the ons that dont have walls or floors) 2: Is there anything anyone can suggest as being obviosly wrong above. I mean it seems to work ok, but I'm open for critisism - but please remember that my maths isnt the greatest, so if you respond with "You should dot the quadrangle of the perpendicular hypotenuse, and then pass that to a Logarithmic algorithm", I may ask for help interpretting it! Cheers (PS the above code is c# - not that it should make too much difference to anyone) Neil
  9. Quote:Just the basic Texture loader methods. And we're running .NET 2.0, but only 1.1 of MDX. Yeah, you have the same config as me then. In a fit of creative thinking, i solved the problem by loading the textures AFTER the Convert call. I think i couldnt see the wood for the trees there! Cheers all. N
  10. Ive checked - ad prior to that call the object is valid. When i F10 over it, the Disposed event is fired and then it steps out of that ConvertMesh call. The bizarre thing is that the array that holds the textures (meshTextures as in the SimpleAnimation sample) is still there, just now pointing at a disposed texture. I am using VS2005, but the 2005 version of the SimpleAnimation works fine, so I'm guessing its not a .net2 issue. Out of interest how do you load the Textures in your code - do you use the ResourceCache, or just the basic TextureLoader? As this is the only bit I modded from the sample, I'm guessing that that **may** have something to do with it?........ Cheese Neil
  11. I have copied some code from the SimpleAnimation sample in the April 2006 SDK into my own app (which doesnt use the framework), but when I call ConvertToIndexedBlendedMesh the texture loaded for the mesh is disposed. I know this as I created an event for the texture dispose and it happens internal to the ConvertToIndexedBlendedMesh call. My code is in escence identical to the sdk example with the main difference being how i load the texture (the sample has some ResourceCache class, whereas I was simply using the TextureLoader. Has anyone else had this? If it was in C++ I'd probably AddRef it 1st, but this is in .net and I cant seem to find a way to sto pthis object from being disposed :( Any help would be awesome. Cheese Neil
  12. Windows startup

    I'm sure someone will explain better than i the **why** but you need to make the CWindows::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) static. Hopefully this will get you on track quicker - as I'm pressed for time and cant elaborate as much as I'd like to. Hope this helps tho ;) N
  13. Sending mail

    The .Net framework provides a decent way to send mail - and in only a few lines of code. Neil
  14. Processing a WAV file

    The file size is about correct given the sound quality settings - its not at cd quality - it was 8 bit at 86kbps. It is recorded onto a ntfs volume, so a 4GB split shouldnt be a problem. Rough calculation : 86(kbps)*60(seconds)*60(minutes)*12(hours)=3715200kb (which is about 3 1/2 GB). Cheers Neil
  15. Hi, I have a WAV file that is so huge that no software will play it - its about 3GB and 12 hours long. I only really need a small chunk of it from the start, but cant seem to get it - I tried writing an app that took the 1st X MBs and saved them to another file, but alas it didnt work. I'm **pretty** sure that the original file is valid as opening in textpad the header looks OK. Obviously I cant test (at this point) that the audio data is good. I'm thinking (for 1 thing) that the length part of the header has overrun the max length of a wav file, as the only app that i have that gives a meaningful error is Quicktime and that says that the file doesnt match the specified length. I'm not very up on audio processing - so does anyone have any ideas as to how to extract this data from the file? I'm imagining that I probably need to load the header into a WAVFORMAT structure and possible modify the length, and then copy the correct length to the file, but is there anything else? Has anyone else tried this? Any ideas would be very very welcome. Cheers Neil
  • Advertisement