hyades.physics.Body.Update C# (CSharp) Méthode

Update() public méthode

public Update ( double elapsed ) : void
elapsed double
Résultat void
        public void Update(double elapsed)
        {
            if (!is_dirty)
                return;

            if (is_merging)
                return;

            SetBodyPositionVelocityForce(position, velocity, force);

                ApplyInternalForces(elapsed);

            UpdatePointMasses(elapsed);
            UpdataAABB(elapsed);

            UpdateBodyPositionVelocityForce(elapsed);

             // get new position/velocity/force
            RotateShape(elapsed);

            if (is_static)
                is_dirty = false;
        }

Usage Example

Exemple #1
0
        public void BuildWall(Plane p)
        {
            ShapeBuilder shapebuilder = new ShapeBuilder(model);

            Matrix transform = GetTransform();
            Vector2[] points = shapebuilder.GetShape(ref transform, p);

            shape = new Shape(points, false);
            offset = shape.GetCenter() - new Vector2(position.X, position.Y);
            shape.CenterAtZero();

            body = new Body(shape, float.MaxValue);
            body.position.X = position.X + offset.X;
            body.position.Y = position.Y + offset.Y;
            body.is_static = true;
            body.Update(0);
        }