Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


maxest

Member Since 05 Nov 2005
Offline Last Active Today, 04:53 PM

Topics I've Started

"Game Physics Engine Development" - resting contacts

13 January 2015 - 05:07 PM

I have a qeustion regarding the book's content, namely resting contacts. I suppose only people who have read the book might be able to answer my question but if you would like to help me but has not read it I can provide any problem's details if necessary.

 

I created a very simple sample using your framework. There is a particle
resting on position (0.0, -0.1, 0.0). Collision happens when Y
coordinate is below -0.1 so this contact is indeed resting. I also add
(0.0, -1.0, 0.0) force each frame. Since the contact is resting I
thought the particle would stand on the ground but it appears to be
bouncing. Why is that so?

Here is the Particle Contact Generator:

class CG : public cyclone::ParticleContactGenerator
{
public:
cyclone::Particle *particle;

virtual unsigned addContact(
    cyclone::ParticleContact *contact,
    unsigned limit
    ) const
{
    if (particle->getPosition().y <= -0.1f)
    {
        contact->contactNormal = cyclone::Vector3(0.0f, 1.0f, 0.0f);
        contact->restitution = 1.0f;
        contact->particle[0] = particle;
        contact->particle[1] = nullptr;
        contact->penetration = -0.1 - particle->getPosition().y;

        return 1;
    }

    return 0;
}
};

 

myPart particle creation:

    cg.particle = &myPart;
    world.getContactGenerators().push_back(&cg);

    myPart.setPosition(0.1f, -0.1f, 0.0f);
    myPart.setVelocity(0.0f, 0.0f, 0.0f);
    myPart.setDamping(1.0f);
    myPart.setAcceleration(0.0f, 0.0f, 0.0f);
    myPart.setMass(1.0f);
    myPart.clearAccumulator();

    world.getParticles().push_back(&myPart);

 

and force that I apply in the update function:

    myPart.addForce(cyclone::Vector3(0.0f, -1.0f, 0.0f));

 

Is that correct that particle myPart should be resting instead of
bouncing off the -0.1 ground?


Street Arena - GTA2 remake

26 July 2014 - 03:35 PM

Hi!

We've just announced our game project which is a GTA2-inspired action multiplayer driving/shooting game with a top-down view. If you're interested, take a look at our website for more information: http://street-arena.com/

If you like the project, please support us:
Facebook - https://www.facebook.com/pages/Street-Arena/1512173568996306
Stream Greenlight - http://steamcommunity.com/sharedfiles/filedetails/?id=290371363
Indie GoGo - https://www.indiegogo.com/projects/street-arena-multiplayer-shooting-racing-game--5/x/8178548

Hope you'll like it :).

Wojtek


Extracting basis vectors from a quaternion

02 May 2014 - 10:43 AM

A 3x3 matrix describes orientation and/or rotation with three (basis) vectors placed in the matrix vectors (or columns). Such a matrix can be converted to a quaternion and vice-versa. I'm wondering how to extract the three basis vectors from the quaternio, without converting the quaternion to a matrix. Is that even possible?


Globals

05 April 2014 - 10:53 AM

Some time ago I worked on a (professional) project in which I was surprised to see quite a lot of globals. There were classes like CRender, CPhysics, CClient and so on, and there was file globals.h that tied together all these classes by declaring GRender, GPhysics, GClient. Now, the entire code relied upon these globals and often even a small change in gpu texture class header caused recompilation of a big part of the codebase (which was medium in size but the total recompilation time was around 1 min).

 

We've heard all these stories about globals being bad and personally I prefer to write code a different way but I must say that working with all these globals was very easy - where ever I was in the code I could always easily access the client's, render's and so on, properties.

 

So, what's your opinion?


Yet Another Programmer's Blog (Rendering Stuff Mostly)

21 February 2014 - 07:48 PM

Here's the link: http://maxestws.blogspot.com/

Hope you'll find something valuable in there :).


PARTNERS