Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think the problem may not be in the collision code, but in how you are updating the position of your Entitys. I don't see any update code or MoveForward(), etc, type of code. First of all, though, I think it would be much easier for you to use a <a href="http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.matrix_members.aspx" rel="nofollow" title="Matrix">Matrix</a> instead of a bunch of float values for rotation. For example, you could have:</p> <pre><code>public class Entity { ... public Matrix RotationMatrix = Matrix.Identity; public Vector3 position; Public Entity(Vector3 FaceDirection, Vector3 UpDirection, Vector3 Position) { ... position = Position RotationMatrix = Matrix.CreateWorld(Position, FaceDirection, UpDirection) } } </code></pre> <p>Then if you want to rotate, all you have to do is:</p> <pre><code>public Void RotateEnt(float Degrees) { RotationMatrix *= Matrix.CreateFromAxisAngle(RotationMatrix.Up, MathHelper.ToRadians(Degrees)); } </code></pre> <p>And if you do all this, then you should easily be able to update your Entity's position, which I think is the problem</p> <pre><code>public Void Update(GameTime gametime) { position += RotationMatrix.Forward * gametime.ElapsedRealTime.TotalMilliseconds * x; //x = some number to scale up or down velocity. } </code></pre> <p>If you do this, I think your Entity's position will be updated, which then should fix your collision problem. But, not knowing how you update the position of your Entities, I am just speculating. HTH</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload