rakoon2

Members
  • Content count

    314
  • Joined

  • Last visited

Community Reputation

140 Neutral

About rakoon2

  • Rank
    Member
  1. Hello! I have a problem with my Matrix2.RotateClockWise( angle ) method! It works perfectly for a while. But it changes from clockwise rotation to countercockwise rotation after ~ 2/3 * PI. Itthen changes back to clockwise after ~2/3 * PI. Why? =§ Here the pseudo function: cos = cos(angle); sin = sin(angle); rotmat = [ cos -sin ] [ sin cos ] newRotatedMatrix = oldMatrix * rotmat; Maybe my drawing code is wrong.. or the function that produces the angle of a matrix2. ( I will post the source code a lil bit later ) Angle method: Returns the angle to the identity matrix. return Acos( m00 / sqrt( m00² + m01² ) ) Thank you guys! :)
  2. Loose trees.. ohh. But a perfect tree for static/non obing objects would be fine? I would have to reload the tree if I change levels or if the player moves over a portal. ( Eg leaving a closed areal. ) Thanks. See you later!
  3. a) It doesn't seem to work with my dlls. If I enable debugging only the.exe cam be debugged. "No iformation aviable". b) Entity[] for a non changing list with random acess List<Entity> for a non chaning list with random acess LinkedList<Enitity> for a changing list. (Iteration only.) Thanks ^^,
  4. Hello guys! I am currently developing 2d stuff for my engine. 1.) Every non static object is a node in a SceneGraph. 2.) Static collision-only objects are put into a AABRTree, axis aligned bounding recteangle tree. This allows fast collision detection. I have a few questions here: a:) Are AABRTress only useful for static / nonmoving objects? I would have to recalculate the tree everytime a object moves! b.) What type of objects should I make the tree for? Currently my collision objects have a Polygon and a Position and are not scenegraph nodes. Bad? =| 3.) How should I lay out my moveable entitys? Entity2 (2 meens 2d) inherites from Node and has a rigid body object inside. The rigid body object itself has the following things: 1.) A polygon 2.) A 2x2 matrix used for rotations 3.) Velocity 4.) Angular Velocity 5.) Mass, Inertia, Density, ... I have already coded a complete collision system btwn polygons. .) More to come :D Thank you for your time. Good bye! :D
  5. Hello all, I have some questions. :) a) How can I enable debugging? ( VC# 2005 Beta1 ) b) What list/collection type should I use for a list of entitys/ collisions objects? List>Bla, LinkedList<Bla>, .. ? Thank you very much. Good bye! :p
  6. Planet Gravity Physics

    Isnt the gravity force calculated by this formula: F = (G * m1 * m2) / r² G.. Gravity constant 6.6742e-11 m1.. Mass of object one. m2.. Mass of object two. r.. Distance btwn the objects. Eg: const double cGravity = 6.6742e-11d; Vector2 Gravity = Vector2.Zero; double distancex = planet1.x - planet2.x; double distancey = planet1.y - planet2.y; double cgf = cGravity * planet1.mass * planet2.mass; Gravity.x = cgf / distancex; Gravity.y = cgf / distancey; planet1.AddForce( Gravity );
  7. Disign questions and more

    Hi! :) "Axis Aligned Bounding Box", well I already have that class. ( 3d ) Im going to use the first class concept. Im going to provide functions that take an extra offset( e.g. position ). @Matrix, well I didnt have that at school yet. Gonna take some time till we will do that. Any >good< tutorials? @Statics, ok. Normal and static functions have the same speed. ( If they are build the same, and use member data. ) A function that doesnt use member data and is static if better than a nonstatic. ( The this pointer isnt used. ) Thanks all. :)
  8. Hello all! I have some design questions. First let me say im using C#. 1.) I have a general quad class representing a quad aligned on the axis: Looks something like this: sealed class AAQuad { private Vector2 position; private Vector2 size; //... public static bool Collides( AAQuad qA, AAQuad qB ){ // .. } } So I store the quad as a position and a size. Well, this isn't so good! Here a new attempt: sealed class AAQuad { private Vector2 min; private Vector2 max; //... public static bool Collides( AAQuad qA, Vector2 posA, AAQuad qB, Vector2 posB ) { // .. } } The quad is represented as a min and a max vector. The Collides() function uses the quad to get the collision mask and an extra vectors for an offset, that is normally inside the position Vector2 in attempt one. Which one is better? I think the 2nd, bcs. a quad is normally used by other higher systems that contain a position. 2.) When should I use static functions? Stroustrup.(spelled wrong) said that you should make as few as possible member functions. ( global in C++, static in C# ) Eg, wat about the Collide() function in my first question. 3.) More will come! ^^ Thank you! :D [/source]
  9. He guys, how about precompiled sin / cos / etc tables? I mean something like that: ( C# code ) Class Tables { float Sin( float angle ) { switch( angle ) { case 12.0f: return 12312.0f; // example case 12.01f: return 12313.0f; // example //.. default: // NOt in the list, calculate it. return System.Math.Sin( angle ); } } }
  10. Never Ending Moving BackGround

    Do you mean something like that: ? I used it in on of my first SDL "games". Worked fine. int screenWidth = 640; int screenHeight = 480; int scrollx = 0; while( false == done ) { //... scrollx =(scrollx % screenWidth); ++scrollx;# DrawBackground( scrollx, 0, image, screen, screenWidth, screenHeight ); //... } /// i void DrawBackground( int scrollx, int scrolly, SDL_Surface* image, SDL_Surface* screen, int screenW, int screenH ) { SDL_Rect dest; SDL_Rect dest2; dest.x = 0 - scrollx; dest.y = 0; dest2.x = screenW - scrollx; dest2.y = 0; SDL_BlitSurface( image, 0, screen, &dest ); SDL_BlitSurface( image, 0, screen, &dest2 ); }
  11. Okay, thanks! :) I used thee .. ermm "public" method. I don't need error checking. Stupid! :) So functions can't return a reference? Are there any ogl font librarys for C#? ( multi platform ) Thanks guys.
  12. Argh, thats it. Thank you! :) I am used to C++! :) ::edit:: New question: (: How can i get a reference to a prim type using properties? See: I have following function: void Bla( ref float f, ref float b ); Now I want to use this function: Bla( ref body.LinearVelocity, ref body.AngVelocity ); But that does not work, because the Properity returns a number, not a variable. I tried to make a properity, that returns a reference( ref float LinearVelocity{ .. } ). The compiler doesn't like that. How could I solve that? It's easy in C++.. ! (: Thank you! [Edited by - rakoon2 on November 6, 2004 10:11:26 AM]
  13. Hello guys! I have a problem with c# delegates. I get this strange compile error: "Inconsistent access. Fieldtyp Enigma.Math.PlayerContactHandle is less accessable than Enigma.Math.RigidBody2D contactHandle." Here some code: namespace Enigma.Math { delegate PlayerContactHandle( Vector2 norm, ref float t, RigidBody2D body, RigidBody2D otherBody ); //... class RigidBody2D { protected PlayerContactHandle contactHandle; //... } } I made a new test project and did the same thing and all works fine. But not so in my real project. =/ The intelisense can find PlayerContactHandle. I am using Vs 2003 and C#. Thank you. :/ [Edited by - rakoon2 on November 6, 2004 10:29:59 AM]
  14. Ah great! :) I also found the sdl sublibs! Thank you! :)
  15. Ahh, thank you! :). I can't find the .zip that contains the newest SDL_video SDL_image SDL_ttf SDL_mixer SDL_event dlls(.NET). http://cs-sdl.sourceforge.net/ does not has them? hmm...