Пример #1
0
        public void Strafe(int dir, float maxDist, List <AABoundingBox> objects)
        {
            vec3 translation_vector = (dir * speed) * camera.GetRightDirection();

            translation_vector.y = 0;
            if (!Collided(objects, translation_vector))
            {
                if (camera.Strafe(dir * speed, maxDist))
                {
                    mPosition += translation_vector;
                    model.TranslationMatrix = glm.translate(model.TranslationMatrix, translation_vector);
                    collider.Translate(translation_vector);
                }
            }
        }