Jump to content
  • Advertisement

Dave Roberts

Member
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

2 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

    Enemy comunication

    Depending on your specific game and situation you can go (or may need to go) more complicated. In order of simplicity: 1. create a hard coded list of vectors that are offsets from the players current postion, Use ticket system to pick any unused one and have the enemy go there to attack - - assumes no terrain or obsticles 2. generate this list in realtime using checks into your world for valid locations -- or just use the preset list and check if a location is not inside a rock or whatever 3. bucket your world into grids or columns and count enemies in your column / grid - blend attack movement vector between less populate one to either side and where you want to go 4. Influence maps (I've never used this exact solution, but have done "field-based" spacing solutions) - more complicated, but also can be much more adaptable ymmv
  2. Dave Roberts

    Enemy comunication

    Create a combat manager / attacker manager that is associated with you player. It would create a list of distinct valid spots for your enemies to move to. When an enemy decides to attack it would first request a free space from manager object and register itself as the occupant of that spot. This way all your enemies can easily have co-ordinated attacking positions without needed to talk to each other.
  3. 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
  4. 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
  5. 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?
  6. 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
  7. 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
  8. 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!