Jump to content
  • Advertisement

Dave Roberts

Member
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Dave Roberts

  • Rank
    Newbie

Personal Information

  • Role
    Technical Director
  • Interests
    Business
    Design
    Production
    Programming

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Dave Roberts

    Incorrect angular collision response

    It is quite possible (i've seen it done on two projects) to get the notation wrong but get the matrix calcs correct and essentially cancel-out errors. i.e. When you look at the math with the operator overloading you think columns, but under hood it is doing rows. I'm not up much on my quaternion derivations, but i would guess the transpose is not correct because Matrix multiplies are not commutive. Being clear on if you are using column or row vectors as a convention is super important though. e.g. Break down some operations - if we have some object and then want to rotate object around y, move x+10 Row vectors: VecNew = VecCurrent * Mat(Translate to origin) * Mat(rotate y) * Mat(Translate to old pos + 10 more x) As a column vector, the operation Vec*Matrix is invalid (3x1) * (3x3) is nonsense and we accumulate matricies on the left: e.g. VecNew = Mat(Translate to old pos + 10 more x) * Mat(rotate y) * Mat(Translate to origin) * VecCurrent Sorry if this is not what you meant and obvious. Keep us posted though - as I am really starting to wonder what the problem is. Suggestion: Write a few hooks to use a debug, unit sized, impulse vector oriented on x,y or z and send it into your calcs at known hit locations for each object. Ensure that this works for both cases where the normal may be inverted depending on the if it object 1 or 2. ?? DR
  2. Dave Roberts

    Incorrect angular collision response

    One thing that jumps out a bit is that your vector3 operator * overload is doing a post-multiply of a column vector V. However, your conversion of the quaternion to a rotation matrix is for pre-multiplying row vectors. To construct a 3x3 rotation matrix suitable for use with a column vector convention you would do the following (Thanks wikipedia!) Conversion to and from the matrix representation[edit] From a quaternion to an orthogonal matrix[edit] The orthogonal matrix corresponding to a rotation by the unit quaternion z = a + b i + c j + d k (with | z | = 1) when post-multiplying with a column vector is given by
  3. Dave Roberts

    Incorrect angular collision response

    hmm you've tried a lot -- backing up one step - are you certain the inertia tensors are correct to start with? How are they constructed?
  4. Dave Roberts

    Incorrect angular collision response

    That part is correct: Normal cross the vector from centre of mass to impact point is a (normalized) torque
  5. Dave Roberts

    Incorrect angular collision response

    Hmm.. I would start with some asserts in there then .. first off, that your contact normal is normalized. Second, that your inertia tensor is orthogonal. [At least I think it should be.. I could be wrong here] Also.. question - is it valid to orient your inverse of the inertia tensor? Or should you be orienting then inverting? Just guessing really! DR
  6. Dave Roberts

    Incorrect angular collision response

    Your second line of code has a little too much "A" in it!
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!