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 Feb 26 2015 04:59 PM

Posts I've Made

In Topic: "Game Physics Engine Development"

13 January 2015 - 02:04 PM

I have a qeustion regarding the book's content, namely resting contacts, and decided to revive this subject. 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?

In Topic: Share the most challenging problem you solved recently! What made you fee...

19 June 2014 - 04:49 AM

I liked the result of my work on implementing a packages system for the engine's filesystem, that supports simultaneous reading, actual file reading, and zip decompression :).


In Topic: Extracting basis vectors from a quaternion

02 May 2014 - 03:02 PM

Okay... I think I get your point but still something bugs me.

Let's put it this way. We have axis-angle representation and want to get the basis-vectors (or matrix if you like). One of the basis vectors is the axis of rotation. How do I compute the other two vectors? The only information I have left is that these two vectors lie on the plane perpendicular to the axis of rotation. And of course I have the angle, which definitely is needed to get the second vector but I'm not sure how.


In Topic: Extracting basis vectors from a quaternion

02 May 2014 - 11:01 AM

Yes but is there any other way? I mean, to sort of "read" the basis vectors straight from the quaternion? Or to put it this way. From a quaternion we can easily read the axis of rotation and the angle. I think that axis-angle and quaternion are equivalent beings. If so, then that means that from axis-angle we could also somewhat "read" the basis vectors. But I don't see how.


In Topic: Globals

16 April 2014 - 12:38 PM

Recently a nice article showed up, http://www.gamedev.net/page/resources/_/technical/game-programming/a-long-awaited-check-of-unreal-engine-4-r3635 where there are parts of Unreal Engine revealed. And what got my attention was this line in one of the listings:

ENGINE_API UEngine* GEngine = NULL;

It looks like even best of the bests use globals... :)


PARTNERS