Exemplo n.º 1
0
        public override void Update(float delta)
        {
            if (_dirty)
            {
                float factor = cp.cpfabs(_newScaleX / _scaleX);

                cpCircleShape shape = (cpCircleShape)_info.GetShapes().FirstOrDefault(); //->getShapes().front();
                cpVect        v     = PhysicsHelper.CCPointToCpVect(Offset);             // cpCircleShapeGetOffset();
                v       = cpVect.cpvmult(v, factor);
                shape.c = v;

                shape.SetRadius(shape.GetRadius() * factor);
            }


            base.Update(delta);
        }
Exemplo n.º 2
0
        protected override float CalculateArea()
        {
            cpCircleShape circle = (cpCircleShape)_info.GetShapes().FirstOrDefault();

            return(cp.AreaForCircle(0, circle.GetRadius()));
        }